On 06/08/2012 09:01 PM, Marc Tompkins wrote: > On Fri, Jun 8, 2012 at 5:10 PM, Mike Nickey <mnic...@gmail.com> wrote: > >> def compareElements(wordList): >> for item in wordList(): >> if item == item.reversed(): >> print item >> else: >> next(item) >> >> > reversed() is not a string method. To reverse a string, try something like > this: > >> if item == item[::-1] >> >
Also next(item) is useless and probably an error. You do not need an else clause there. the for loop takes care of those details. -- DaveA _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor