Skip to content

Number Guessing Game Overview: This repository contains a simple Number Guessing Game implemented in Python. The game generates a random number between 1 and 100, and the user is prompted to guess the correct number. The script provides feedback on whether the guess is too low or too high and congratulates the user upon a correct guess.

Notifications You must be signed in to change notification settings

Umerjamshaid/BanoQabil-2.0-Python-Course

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Number Guessing Game

Problem Statement

Create a simple Number Guessing Game in Python.

Code Structure

The Python script Number_Guessing_Game.py contains a function start_game that initiates the Number Guessing Game. The game generates a random number between 1 and 100, and the user is prompted to guess the correct number. The script provides feedback on whether the guess is too low or too high and congratulates the user upon a correct guess.

How to Run

  1. Ensure you have Python installed on your machine.
  2. Open a terminal or command prompt.
  3. Navigate to the directory containing Number_Guessing_Game.py.
  4. Run the script using the command: python Number_Guessing_Game.py.

Example Output

Welcome to the Number Guessing Game! I'm thinking of a number between 1 and 100. Can you guess it?

Enter your guess: 50 Too low. Try again.

Enter your guess: 75 Too high. Try again.

Enter your guess: 60 Congratulations! You guessed the correct number 60 in 3 attempts.

About

Number Guessing Game Overview: This repository contains a simple Number Guessing Game implemented in Python. The game generates a random number between 1 and 100, and the user is prompted to guess the correct number. The script provides feedback on whether the guess is too low or too high and congratulates the user upon a correct guess.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages