Guessing Game | |||||
number = 7 guess = input(“Guess a number between 1 and 10”) while int(guess) != number: guess = input(“Guess again”) print(“Congratualations!”) | Guess a number between Guess again 7 Congratulations! | 1 | and | 10 | 5 |
difficulty = input("Enter a level of difficulty - easy/medium/hard")
if difficulty == "easy": max = 10
elif difficulty == "medium": max = 20
elif difficulty == "hard": max = 50
number = random.randint(1, max)