for statement on empty iterable

james_027 cai.haibin at gmail.com
Wed Aug 22 07:52:37 CEST 2007


hi,

> It sounds like you're just starting to learn the language... have you
> read the online tutorial yet?  That is a pretty easy introduction.
>
> See:http://python.org/doc/
>
> Anyway, you can say
>
>    for i in (1,2,3):
>       print i*5
>
> to print 5, 10, and 15 on separate lines, for example.

Yes i am new to python :). I am sorry I should be clarify myself ...
for example

l = ['j', 'a', 'm', 'e', 's']

for i in l
 # i want to know the nth number of times it has loop thru or
something like counter?

Thanks
james




More information about the Python-list mailing list