@seamuswalden3/

GenuineLimeUsers

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
18
19
20
21
22
import random

run = True
num = random.randint(1, 100)
tries = 0

while run:
    try:
        guess = int(input("What is your guess: "))
    except Exception:
        print("Please print a real number")
    else:
        if guess > num:
            print("To high")
        if guess < num:
            print("To low")
        if guess == num:
            run = False
        tries += 1

print("You guessed it in {} tries".format(tries))