Posted January 14Jan 14 Create an interactive Number Guessing Game that allows the user to guess a randomly generated number within a specified range.Basic Requirements:The program should randomly select a number between 1 and 100.Prompt the user to guess the number.Provide feedback:"Too high" if the guess is higher than the target number."Too low" if the guess is lower than the target number."Correct!" when the guess is right.Keep track of the number of attempts and display it when the user guesses correctly.Bonus Features:Allow the user to set their own range (e.g., 1 to 1000).Implement a hints system that gives additional clues, such as whether the number is even or odd.Add an option to play again after the game ends.Example Output:Welcome to the Number Guessing Game! I'm thinking of a number between 1 and 100. Enter your guess: 50 Too high! Try again. Enter your guess: 25 Too low! Try again. Enter your guess: 33 Correct! You guessed it in 3 attempts.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.