> generate the index and value of a string's characters in a single for
> statement.  Is this true or did imagine it?

>>> for i,c in enumerate('fred'): print i,c
...
0 f
1 r
2 e
3 d


Like that?

Alan G.

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to