From ba7ff7586da987aac3ef23f72489f413cdfd11fb Mon Sep 17 00:00:00 2001 From: Amrita8642 Date: Sat, 4 Oct 2025 15:00:10 +0530 Subject: [PATCH 1/2] Added Project 61 --- CONTRIBUTER_INFO.md | 6 ++++++ Project-61-Numberguess/Numberguess.py | 26 ++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 Project-61-Numberguess/Numberguess.py diff --git a/CONTRIBUTER_INFO.md b/CONTRIBUTER_INFO.md index 574af92..66eac71 100644 --- a/CONTRIBUTER_INFO.md +++ b/CONTRIBUTER_INFO.md @@ -28,3 +28,9 @@ - Collage name : CV Raman
+
+ +- Name : Amrita Kumari +- Collage name : Bharati Vidyapeeth College of Engineering + +
diff --git a/Project-61-Numberguess/Numberguess.py b/Project-61-Numberguess/Numberguess.py new file mode 100644 index 0000000..6ba4b80 --- /dev/null +++ b/Project-61-Numberguess/Numberguess.py @@ -0,0 +1,26 @@ +import random + +def guessing_game(): + # Generate a random number between 1 and 100 + number_to_guess = random.randint(1, 100) + attempts = 0 + print("Welcome to the Number Guessing Game!") + print("I have chosen a number between 1 and 100. Can you guess it?") + + while True: + try: + guess = int(input("Enter your guess: ")) + attempts += 1 + + if guess < number_to_guess: + print("Too low! Try again.") + elif guess > number_to_guess: + print("Too high! Try again.") + else: + print(f"🎉 Congratulations! You guessed the number {number_to_guess} in {attempts} attempts.") + break + except ValueError: + print("Please enter a valid number!") + +# Run the game +guessing_game() From 9df41e6f697e59de5a6731ed10846a98c31420fb Mon Sep 17 00:00:00 2001 From: Amrita8642 Date: Sat, 4 Oct 2025 18:57:21 +0530 Subject: [PATCH 2/2] Create Readme.md Signed-off-by: Amrita8642 --- Project-61-Numberguess/Readme.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Project-61-Numberguess/Readme.md diff --git a/Project-61-Numberguess/Readme.md b/Project-61-Numberguess/Readme.md new file mode 100644 index 0000000..e441862 --- /dev/null +++ b/Project-61-Numberguess/Readme.md @@ -0,0 +1,21 @@ +# Number Guessing Game 🎯 + +A simple and fun Python game where the computer randomly selects a number between 1 and 100, and the player has to guess it. + +## Overview +The Number Guessing Game is an interactive console game built using Python. It challenges the player to guess a randomly chosen number within the range of 1 to 100. The game provides hints whether the guess is too low or too high, making it both fun and engaging. + +## Features +- Random number generation between 1 and 100. +- Keeps track of the number of attempts. +- Provides feedback: too low or too high. +- Handles invalid inputs gracefully. +- Simple and beginner-friendly Python code. + +## Installation +1. Make sure you have Python installed. You can download it from [python.org](https://www.python.org/). +2. Clone this repository or download the `guessing_game.py` file. +3. Open your terminal or command prompt in the project directory. + +```bash +git clone