[Tutor] Help with guess my number game

2014-10-13 Thread אופיר לירון
Hi,I am new into Python, and using the bookPython Programming for the Absolute Beginner byMichael Dawson.One of the taks in chapte 3 is to change the "guess my number game" to include only 5 gusses and give appropriate messege at the end (in case no sucssesful guess was done).I have tried to add

Re: [Tutor] Help with guess my number game

2014-10-13 Thread Danny Yoo
if guess != the_number: print (you failed, the number was, the_number) elif guess==the_number: print(You guessed it! The number was, the_number) print(And it only took you, tries, tries!\n) This block of code appears to be applied for every iteration

Re: [Tutor] Help with guess my number game

2014-10-13 Thread Alan Gauld
On 13/10/14 11:40, אופיר לירון wrote: # set the initial values the_number = random.randint(1, 100) guess = int(input(Take a guess: )) tries = 1 # guessing loop while guess != the_number: if guess the_number: print(Lower...) else: print(Higher...) guess =