On Sun, 1 Dec 2013 14:32:38 +1000, Amit Saha <amitsaha...@gmail.com> wrote:
I was told by someone (as a comment) that a code snippet such as
this
"would make Pythonistas talk my ear off about how evil the append()"
function is:

>>> mylist = []
>>> mylist.append(1)

Nothing evil about append. Many times the list can be built more prettily with a list comprehension, but if you're building it in a for loop, append does the job.

--
DaveA

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

Reply via email to