"zannah marsh" <[EMAIL PROTECTED]> wrote > rikart pointed out that you need to use a range to get to the > indicies of > the items in the string. > > for item in range(len(string))... > if word1[item] == word2[item] >
There is another way which is to use enumerate which returns both the item and its index. >>> for i,c in enumerate('abcd'): >>> print c, 'at', i a at 0 b at 1 c at 2 d at 3 But range() works just as well in this case. -- Alan Gauld Author of the Learn to Program web site http://www.freenetpages.co.uk/hp/alan.gauld _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor