----- Original Message ----- > From: Dave Angel <da...@davea.name> > To: tutor@python.org > Cc: > Sent: Thursday, April 17, 2014 12:03 PM > Subject: Re: [Tutor] List issues > >& quot;Wheeler, Gabriel" <wheel...@seattleu.edu> Wrote in message: >> > > (not much I could read there. This is a text mailing list, so > please tell your mail program to send in text mode, not html. > Only parts of your code were visible here, and your question not > at all. Fortunately, Peter quoted all or most of your message. > His comments are all good. Mine are in addition, not instead. > > > Your code: > > list = [1,2,2,2,3,4] > > def duplicate(list): > for i in range(len[list]): > if list.count(i) > 1: > return True > > print duplicate(list) > > ............ > > Peter's hints should fix your main bugs. Then: > > When an if-test doesn't seem to be doing what you expect, add a > print statement right before it of the exact expression it's > testing.
and/or use the pdb debugger (still on my own todo list, but I know it is useful!): http://pymotw.com/2/pdb/ _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor