[Tutor] generating coordinates between two pairs

Shashwat Anand anand.shashwat at gmail.com
Mon Feb 22 17:07:13 CET 2010


>>> [(i,j) for i in range(4, 5+1) for j in range(7, 9+1)]
[(4, 7), (4, 8), (4, 9), (5, 7), (5, 8), (5, 9)]

On Mon, Feb 22, 2010 at 9:33 PM, Jojo Mwebaze <jojo.mwebaze at gmail.com>wrote:

> sorry guys, i found a solution, ignore the post
>
> cheers
>
> Johnson
>
>
> On Mon, Feb 22, 2010 at 4:57 PM, Jojo Mwebaze <jojo.mwebaze at gmail.com>wrote:
>
>> Hello There,
>>
>> I got two pairs of coordinates say (4,5) and (7,9) from these two pairs i
>> would like to generate two lists
>>
>> [4, 4, 4, 4, 4,    5, 5, 5, 5, 5,    6, 6, 6, 6, 6,    7, 7, 7, 7, 7]
>>
>> and
>>
>> [5, 6, 7, 8, 9,    5, 6, 7, 8, 9,    5, 6, 7, 8, 9,   5, 6, 7, 8, 9]
>>
>> i am actually generating all coordinates that fall within (4,5) and (7,9)
>>
>> Any help
>>
>> cheers
>>
>> Johnson
>>
>>
>>
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100222/8cb6d6a0/attachment.html>


More information about the Tutor mailing list