Re: [Tutor] While Loop Help

2014-12-11 Thread James Chapman
While Alan has given you a far better solution, I feel someone should mention the break statement as you will likely come across it a lot, and it is quite an important flow control statement. You could add a break statement to the else which would break out of the while loop. https://docs.python.o

Re: [Tutor] While Loop Help

2014-12-11 Thread Steven D'Aprano
On Wed, Dec 10, 2014 at 11:20:12PM -0500, Matthew Nappi wrote: > I am working on the challenges from “Python Programming for the Absolute > Beginner” Chapter 3. I am asked to modify the original code pasted below > to limit the number of guesses a player has to guess the number. I did so > (code

Re: [Tutor] While Loop Help

2014-12-11 Thread Alan Gauld
On 11/12/14 04:20, Matthew Nappi wrote: (code pasted below); however if a player guesses the right number they still receive an ending message indicating that they failed. How can I modify the code without using any advanced techniques to have a different message in the event of a successful gu

[Tutor] While Loop Help

2014-12-11 Thread Matthew Nappi
Hello All: I am working on the challenges from “Python Programming for the Absolute Beginner” Chapter 3. I am asked to modify the original code pasted below to limit the number of guesses a player has to guess the number. I did so (code pasted below); however if a player guesses the right numb