PIYUSH

Generation

generate functionSat, 19 Nov 2022

Random game

def game(): import random secret_number = random.randint(1, 10) while True: guess = int(input("Guess a number between 1 and 10: ")) if guess == secret_number: print("You win!") break else: print("Try again")

Questions about programming?Chat with your personal AI assistant