number of loops

Dan Stromberg drsalists at gmail.com
Thu Mar 15 16:46:59 EDT 2018


On Thu, Mar 15, 2018 at 8:25 AM, Bob Gailer <bgailer at gmail.com> wrote:
> On Mar 15, 2018 9:30 AM, <michealmancini at gmail.com> wrote:
>>
>> I would like to have this offer 6 guesses, but instead it gives one guess
> and prints the if statement/output 6 times....any ideas where I went wrong?
>
> I suggest you conduct a walk-through. That means pointing using a pencil or
> a mouse pointer at each statement and noticing what it does. pay attention
> to what happens when the loop repeats.

I'm guessing a GUI or curses debugger would help quite a bit.   EG's:
winpdb, pudb.  winpdb is cross-platform, despite the name.  pudb might
not work on Microsoft Windows, though perhaps it would in Cygwin.

These, and many other debuggers allow you to single step through your
code and see what the execution order is, one statement at a time.
It's a pretty valuable learning experience early on, IMO.



More information about the Python-list mailing list