On 23/03/17 10:15, Richard Mcewan wrote:

> #loop to check guess and report
> while userGuess != computerGuess:
>       if userGuess < computerGuess:
>               print('Too low')
>               userGuess = getUser()
>       elif userGuess > computerGuess:
>               print('Too high')
>               userGuess = getUser()

One tiny tweak would be to remove the userGuess = getUser()
lines from the if/elif structure and just have a single
assignment at the end of the loop. It just saves
duplication and so means less work if you ever have
to change that line.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to