"+=" does not work correct all alogn

woooee woooee at gmail.com
Wed Jan 18 12:42:01 EST 2012


> def conc1(a, _list = []):
>     _list = _list + [a]
>     return _list

> for i in range(4):
>     _list = conc1(i)   ## <----- list not passed

You don't pass the list to the conc1 function, so you start with the
default, an empty list, each time.



More information about the Python-list mailing list