2022PythonExamples/6 - While Loops Break Continue and Loop Translation/Challenge/main.py

16 lines
326 B
Python

import random
randomValue = random.randint(1, 100)
guess = -1
while randomValue != guess:
guess = int(input("Guess the number: "))
if guess < randomValue:
print("You're too low")
elif guess > randomValue:
print("You're too high")
else:
print("You guessed the right number")