On 3/6/07, zannah marsh <[EMAIL PROTECTED]> wrote:

> step through them as you would in an array or list. so i had this:
>  for i in word1
>      if word1[i] == word2[i]...

For this construction to work in Python, you use the range()-function.

for index in range(len(word1)):
    ....

Say word1 is "parrot", len(word1) == 6, range(len(word1)) = 0,1,2,3,4,5.


-- 
- Rikard.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to