@BenTerry/

Random Number Guessing Game

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import random
z = 1
x = random.randint(1, 10)
print("I am thinking of a number between 1 and 10.")
y = int(input("Can you guess what it is? Enter your guess: "))
print("")
while z != 0:
  if y > x:
    y = int(input("Too high. Try again: "))
    z += 1
  elif y < x:
    y = int(input("Too low. Try again: "))
    z += 1
  else:
    print("Well done you figured out the number do you want a medel, because your not getting one")
    break
print("You took", z, "guesses to figure it out.")