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
>
> 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 e
Hi,I am new into Python, and using the bookPython Programming for the Absolute Beginner by Michael 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 b