Why does the insert after list function fail?

Jussi Piitulainen jussi.piitulainen at helsinki.fi
Fri Sep 23 00:59:04 EDT 2016


380162267qq at gmail.com writes:

> A=["1","2","3"]
> print(list(map(float,A)).insert(0,1))
>
> I want to insert 1 at the head of the list but this gives me a surprise

Is it the same surprise that you get from print([1,2,3].insert(0,1))?

Or the more advanced surprise from print(A.insert(0,1))?



More information about the Python-list mailing list