Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import colors as c
- import random
- k = random.randint(500,500000)
- x = random.randint(1, k)
- t = True
- z = 0
- p=0
- #open('number.txt')
- while (t):
- y = eval(input("what number do you guess: "))
- z += 1
- if x > y:
- print(c.blue("too low"))
- if x < y:
- print(c.red("too high"))
- if x == y:
- print("you guessed it")
- print("it took you", z, "times to guess the number")
- f = input("play again?: ")
- if f == "yes" or f == "y":
- x = random.randint(1, k)
- else:
- t = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement