[Tutor] Python Question - Repeating output.
Danny Yoo
dyoo@hkn.eecs.berkeley.edu
Sun, 9 Jun 2002 00:48:13 -0700 (PDT)
> > Here's one way to fix that:
>
> > .......
>
> > ###
> > a = input("Pick a number that is not lame:")
> > while a==69:
> > print "Good job!"
> > while a !=69:
> > print "Moron."
> > a = input("Play it again, Sam: ")
> > ###
> >
> >
>
> deh! still buggy (or did you intend infinite good jobs with 69?):
>
> Pick a number that is not lame:69
> Good job!
> Good job!
> Good job!
> Good job!
> Good job!
> Good job!
> Good job!
> Good job!
Yikes! Well, at least it's complementary. *grin*
I was thinking of that second infinite loop, but you're right: the first
bug sideswiped me. I have tunnel vision, which helps when I'm hunting
specific bugs, but I sometimes don't look at the big picture.
Thanks for the correction!