Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CONTRIBUTER_INFO.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@
- Collage name : CV Raman

<br>
<br>

- Name : Amrita Kumari
- Collage name : Bharati Vidyapeeth College of Engineering

<br>
26 changes: 26 additions & 0 deletions Project-61-Numberguess/Numberguess.py
Original file line number Diff line number Diff line change
@@ -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()
21 changes: 21 additions & 0 deletions Project-61-Numberguess/Readme.md
Original file line number Diff line number Diff line change
@@ -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 <repository-url>