Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 970 Bytes

File metadata and controls

36 lines (25 loc) · 970 Bytes

Number Guessing Game (Python)

Description

This is a simple Python number guessing game where the computer randomly selects a number between 1 and 10, and the player has 3 valid attempts to guess it correctly.


How the Game Works

  1. The computer randomly generates a number between 1 and 10.

  2. The player is prompted to guess the number.

  3. The player has 3 valid guesses:

    • Invalid inputs (non-integers or numbers outside the range) do not count as attempts.
  4. If the player guesses correctly, the game ends with a success message.

  5. If all attempts are used, the correct number is revealed.

  6. The player is then asked whether they want to play again.


Sample Output

The Computer has chosen a random number between 1 and 10!
You have 3 tries!! Guess the number~
Enter your guess: 5
Wrong guess, 1 try used.
Try Again..
Enter your guess: 7
You guessed Correct!!
Do you want to play again? (y/n):