On Wed, Feb 3, 2010 at 8:19 AM, David <ld...@gmx.net> wrote:
> Hello Bob,
>
> thanks for your comments!
>
>
> On 03/02/10 14:51, bob gailer wrote:
>
>> or if you seek terseness:
>>
>> terms = [random.randint(1, 99) for i in 'ab']
>
> Do I understand correctly that 'ab' here merely serves to produce a 'dummy
> sequence' over which I can run the for loop?
>

That is correct. you could have used any two-character sequence. I
think the range(2) call is clearer and more pythonic though. And it's
not that much longer

Hugo
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to