Help with "Guess the number" script

Chris Angelico rosuav at gmail.com
Sat Mar 1 20:16:10 EST 2014


On Sun, Mar 2, 2014 at 12:11 PM, Scott W Dunning <swdunning at cox.net> wrote:
>>    print('You got it in ', count, 'guesses.')
>>
> Thanks Susan!  The only problem is he wants us to do it without loops because we haven’t learned them yet. I need to use the variables and function names that he’s given as well.  I think I can make sense of what you wrote though so that should help me a bit.
>

Another consideration: Susan's code is written for Python 3, but you
seemed to be using Python 2. You'll find that the code won't even run
on your version of Python.

(If you have the chance, ask if the course writer would consider
updating it to use Python 3. There's getting to be less and less
reason to use Python 2 for any new projects; when you start a brand
new system, you should be using Python 3 unless there's something
holding you on the old version. So it's correspondingly more useful to
learn Py3.)

ChrisA



More information about the Python-list mailing list