Nov-25-2017, 03:49 PM
import random from random import randint x = [random.randint(1,100)] print("Guess a number between 1 and 100.") while True: guess = int ( input("a numer: ") ) if str(guess) == str(x): print("Congratulations!") elif str(guess) < str(1) or str(guess) > str(100): print("You have to choose a number between 1 and 100.") print("Please guess again.") elif str(guess) < str(x): print("Please choose a higher number.") elif str(guess) > str(x): print("Please choose a smaller number.")