No typical loops, and other crazy ideas
__peter__ at web.de
Thu Jan 6 09:32:35 CET 2005
> motivation). I've tried to manipulate the data just in Python
> and not in typical loops. One thing that may not be entirely
A list comprehension is just a fancy way to write a loop. Resisting the
temptation to use it can sometimes improve your code.
> [Also, for some reason the advice by another poster, to
> instead of:
> oldl=[x for x in orig]
> ..somehow didn't work. The first instruction has produced only empty
> #---------Code follows-----------
Because you used the same reader twice newl will always be empty.
More information about the Python-list