print Hello guess number from to 10 You have tries import random guess

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
print("Hello, guess number from 1 to 10. You have 5 tries.")
import random
guessTaken = 0
num = random.randint(1,10)
while guessTaken < 5:
guess = input()
guess = int(guess)
guessTaken = guessTaken + 1
if guess != num and guessTaken != 5:
print("Try again!")
if guess == num:
break
if guess == num:
guessTaken = str(guessTaken)
print('Good job,! You guessed my number in ' + guessTaken + ' guesses!')
if guess != num:
num = str(num)
print('Nope. The number I was thinking of was ' + num)