Iteration index

Marek Augustyn maug at kopnet.gliwice.pl
Thu May 31 14:48:12 EDT 2001


Hello!

1. Do I have to use additional variable when I want to know iteration index?
Example:

s = ('a', 'b', 'ala', 'a')
i = 0 # additional variable
for el in s:
    print i, el
    i += 1

2. Are there block comments in Python? (like /* */ in C)

Regards,
August





More information about the Python-list mailing list