Closed activus-d closed 1 year ago
import random
def random_number_game():
random_number = int(random.random() * 100)
while True:
print("Guess a number between 1-100")
try:
user_input = int(input())
except ValueError:
print("Please enter a number")
if user_input == random_number:
print("Yay, you win!")
break
elif user_input > random_number:
print("Too high Please try again.")
elif user_input < random_number:
print("Too low. Please try again.")
random_number_game()
hi, my name is Sriram Bharadawaj mail id - sriram9217@gmail.com
I would like to complete this code if you can assign me to it
Python coding challenge by Storm Program a game where the user has to guess a random number generated by the program. The program gives hints if the user’s input is lower or higher than the random number. The game ends when the user's input is the same as the random number. Conditions