conditional for-statement

seb sdementen at
Sun Aug 23 10:09:04 CEST 2009


i was wondering if there is a syntax alike:

for i in range(10) if i > 5:
    print i

equivalent to

for i in (for i in range(10) if i>5):
    print i


More information about the Python-list mailing list