List Order of Initialization

Diez B. Roggisch deets at nospam.web.de
Fri Oct 10 17:00:54 CEST 2008


SamFeltus schrieb:
> When a list initializes, will it always evaluate in order starting at
> element 0 and finishing with the last element?
> 
> def f1(x):
>     return x + 2
> 
> def f2(x):
>     return x * 2
> 
> def f3(x):
>     return x * 3
> 
> the_list = [f1(7), f2(8), f3(4)]

Yes.

Diez



More information about the Python-list mailing list