Re: index in for loops

2006-05-17 Thread Wojciech Muła
manstey wrote: > in for loops like the following: > > word='abcade' > > for letter in word: >print letter > > > Is it possible to get the position of letter for any iteration through > the loop? for index, letter in enumerate(word): print index, letter -- http://mail.python.org/mailma

index in for loops

2006-05-17 Thread manstey
in for loops like the following: word='abcade' for letter in word: print letter Is it possible to get the position of letter for any iteration through the loop? so for examlpe letter=='a', and I want to know if it is the first or second 'a' in 'abcade'. can i do this by looking at a proper