D
Dave Opstad
I'm running into a strange behavior under Python 2.3.3:
------------------------------------------
File "<stdin>", line 1, in ?
TypeError: iteration over non-sequence
------------------------------------------
Can someone enlighten me as to why the list comprehension gives an
error, but the simple list construction case works fine?
Thanks for any help!
Dave Opstad
------------------------------------------
Traceback (most recent call last):d = {-1: 'cv', -2: 'se', -3: 'se'}
d {-1: 'cv', -2: 'se', -3: 'se'}
len(d) 3
[d[-1], d[-2], d[-3]] ['cv', 'se', 'se']
[d[-1-i] for i in len(d)]
File "<stdin>", line 1, in ?
TypeError: iteration over non-sequence
------------------------------------------
Can someone enlighten me as to why the list comprehension gives an
error, but the simple list construction case works fine?
Thanks for any help!
Dave Opstad