Number Guessing Game Using Python 3
Number Guessing Game Using Python 3: import random num_rounds = 5 max_guesses = 10 score = 0 print ( "Welcome to the Number Guessing Game!" ) print ( "You will play" , num_rounds, "rounds. Each round, you have to guess a number between 1 and 100." ) print ( "You will score points based on the number of attempts taken to guess the number." ) print ( "Let's get started! \n " ) for i in range (num_rounds): secret_number = random.randint( 1 , 100 ) num_guesses = 0 print ( "Round" , i+ 1 , "starts now!" ) # print("Your Guessing Number is:",secret_number) while num_guesses < max_guesses: guess = int ( input ( "Guess a number between 1 and 100: " )) num_guesses += 1 if guess == secret_number: print ( "Congratulations! You guessed the secret number in" , num_guesses, "guesses!" ) ...