Skip to content

This is a simple Python game where the user guesses a random number chosen by the computer. It’s a fun way to practice loops, conditionals, and user input — perfect for beginners.

Notifications You must be signed in to change notification settings

janee1768/Number-Guessing.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

🎯 Number Guessing Game – Python Project

This is a fun and simple Python game where the computer randomly picks a number, and the user has to guess what it is. The goal is to guess the correct number in as few tries as possible.

🕹️ How the Game Works

When the program starts, it asks the user to enter a maximum number. The computer then randomly picks a secret number between 0 and that maximum number.

The user is then asked to make a guess. After each guess:

  • If the guess is too low, the program says "You are below the number!"
  • If the guess is too high, it says "You are above the number!"
  • If the guess is correct, it says "You got it!" and ends the game

The program also counts how many guesses the user makes and shows the total number at the end.

✅ Features

  • Takes a custom top number from the user
  • Picks a random number each time
  • Gives hints to guide the user (higher or lower)
  • Tells how many guesses were made
  • Uses basic Python functions and logic

🧠 What You Learn

This project helps beginners understand:

  • input() and print() functions
  • Using if, elif, and else statements
  • while True loops
  • Random number generation using random.randint()
  • Basic error handling

About

This is a simple Python game where the user guesses a random number chosen by the computer. It’s a fun way to practice loops, conditionals, and user input — perfect for beginners.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages