a wrote: > can someone tell me how to use them > thanks basically, a list comprehension is just like a for loop, if you wrote it out the "long way" it would be something like this:
results = []
for var in some_iterable:
if some condition:
results.append(some expression)
The list comprehension version:
results = [some expression for var in some_iterable if some condition]
There's more to it, but that's the basic idea.
Hope this helps,
~Simon
--
http://mail.python.org/mailman/listinfo/python-list
