Hello Python enthusiasts! Let's add an exciting game to our repository - a Number Guessing Game implemented in Python. This beginner-friendly task involves creating a program that generates a random number and allows users to guess the number within a certain range. This game will showcase random number generation, loops, conditional statements, and user input handling in Python.
Tasks:
Generate a random number within a specified range (e.g., between 1 and 100).
Allow users to guess the number.
Provide hints (higher/lower) to guide the user's guesses.
Limit the number of attempts and end the game if the user exceeds the limit.
Display a victory message if the user guesses the number within the allowed attempts.
Guidelines:
Use Python 3.x for the program.
Utilize the random module to generate random numbers.
Include clear instructions and prompts for the user.
Handle invalid inputs gracefully and provide appropriate error messages.
Include comments in your code to explain the logic and functionality.
Test the game thoroughly to ensure it provides an engaging user experience.
Example:
Welcome to the Number Guessing Game!
I'm thinking of a number between 1 and 100.
Enter your guess: 50
Too low! Try again.
Enter your guess: 75
Too high! Try again.
Enter your guess: 60
Correct! Congratulations, you guessed the number in 3 attempts!
How to Contribute:
Fork this repository.
Create a new Python file for the Number Guessing Game: number_guessing_game.py.
Write the Python program following the specified tasks and guidelines.
Test the game thoroughly to ensure it functions correctly.
Commit your changes: git commit -m "Add Number Guessing Game program"
Push to your branch: git push origin add-number-guessing-game
Open a pull request to this repository.
Your contribution will provide users with an enjoyable guessing game experience. Thank you for creating this entertaining Python program for our repository!
Hello Python enthusiasts! Let's add an exciting game to our repository - a Number Guessing Game implemented in Python. This beginner-friendly task involves creating a program that generates a random number and allows users to guess the number within a certain range. This game will showcase random number generation, loops, conditional statements, and user input handling in Python.
Tasks:
Guidelines:
random
module to generate random numbers.Example:
How to Contribute:
number_guessing_game.py
.git commit -m "Add Number Guessing Game program"
git push origin add-number-guessing-game
Your contribution will provide users with an enjoyable guessing game experience. Thank you for creating this entertaining Python program for our repository!