Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added a Python script for Number Guessing Game #501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Saurabh6266 wants to merge 1 commit into DhanushNehru:main
base: main
Choose a base branch
Loading
from Saurabh6266:add-number-guessing-game

Conversation

@Saurabh6266
Copy link

@Saurabh6266 Saurabh6266 commented Oct 28, 2025

This pull request adds a new Python script named number_guessing_game.py that implements a simple Number Guessing Game.

In this game:

  • The program randomly selects a number within a specific range (default: 1–100).
  • The player tries to guess the number.
  • After each guess, the program provides hints:
    • "Too high!" if the guessed number is greater than the target.
    • "Too low!" if the guessed number is smaller than the target.
  • The game continues until the correct number is guessed.
  • Once the player wins, the program displays the total number of attempts taken.

This script is designed to be beginner-friendly, fully interactive, and easy to run from the command line.
It also uses Python’s built-in random module for number generation and loops for continuous gameplay.

Thank you so much!!!

Copy link
Author

Hello, I am a 2nd year college student and this is my first open source contribution. I want to make a good contribution in Hacktoberfest. I am respectfully eager to see your response towards this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /