Re: Help With Python
Nick Craig-Wood wrote:[color=blue]
> Steven Bethard <steven.bethard @gmail.com> wrote:[color=green]
>> py> orders = [Viking().order( )] * 7
>> py> ', '.join(orders)
>> 'Spam, Spam, Spam, Spam, Spam, Spam, Spam'[/color]
>
> Thats still one Viking making 7 orders surely?
>
> So you want this...
>[color=green][color=darkred]
>>>>orders = [ Viking().order( ) for _ in range(7) ][/color][/color][/color]
Right, right. Thanks for the correction! This is why I never use the *
operator on lists. ;)
Steve
Nick Craig-Wood wrote:[color=blue]
> Steven Bethard <steven.bethard @gmail.com> wrote:[color=green]
>> py> orders = [Viking().order( )] * 7
>> py> ', '.join(orders)
>> 'Spam, Spam, Spam, Spam, Spam, Spam, Spam'[/color]
>
> Thats still one Viking making 7 orders surely?
>
> So you want this...
>[color=green][color=darkred]
>>>>orders = [ Viking().order( ) for _ in range(7) ][/color][/color][/color]
Right, right. Thanks for the correction! This is why I never use the *
operator on lists. ;)
Steve
Comment