Re:Common Python Mistakes
by dragonwriter on Thursday May 08, 2014 @02:02PM
(#7716668)
Unless its Python 3.x.
Though, really, even there, while the list comprehension works, its kind of an awkward construction to use that instead of:
numbers = list(range(10))not in Python 3, where range() replaces xrange()
Re:Common Python Mistakes
by dmritard96 on Thursday May 08, 2014 @01:57PM
(#7716639)
interesting, haven't written in python 3 yet
numbers = [n for n in range(10)]
this should be: range(10)