FFFF Python_ExtraProjects/Extra_Credit_Project01 at main · samabda2/Python_ExtraProjects · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Guess the Number Game

Welcome to the Guess the Number project! In this assignment, you will create a fun game where players guess a randomly generated number.

About the Game

  1. The program generates a random number between 1 and 1000.
  2. The player enters their guess.
  3. The game gives feedback:
    • "Too high!" if the guess is above the number.
    • "Too low!" if the guess is below the number.
    • "Correct!" if the guess is right.
  4. If the player guesses correctly before using all 10 chances, the game will congratulate them and ask if they want to play again.
  5. If the player does not guess the number within 10 chances, the game will inform them that they have lost and ask if they want to play again.

Requirements

  • Write a Python program to implement the game.
  • Use the random module to generate a random number.
  • Handle invalid inputs (like letters or special characters) by prompting the user to enter a valid number.

Points Breakdown

You can earn a total of 5 points for this project:

  • 1 Point: The game works correctly (generates a random number, allows 10 guesses, and provides feedback).
  • 1 Point: The program handles invalid input gracefully and has clear instructions for the player.
  • 1 Point: The game allows the player to choose to play again after winning or losing.
  • 1 Point: The game ends correctly after either winning or losing, providing appropriate messages.
  • 1 Point: The code is well-organized and includes comments explaining key parts of the program.

Submission

  1. Submit your Python code as a .py or.ipynb file.
  2. Include comments in your code to explain what each part does.

Have fun coding!

0