Skip to content

It is a number-guessing game written in Python. The basic idea is to have the computer produce a random number between 1 and 100 and then have the user try to guess it.

License

Notifications You must be signed in to change notification settings

Nalini1998/Python-Guessing-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python Guessing Game

This is a fun little project that I like to do in my spare time. It is a number-guessing game written in Python. The basic idea is to have the computer produce a random number between 1 and 100 and then have the user try to guess it.


Python Guessing Game


In this code, we first welcome the user and generate a random integer between 1 and 100 as the secret number. Then we give the user 5 chances to guess the number using a while loop. Inside the loop, we take the user's guess and compare it with the secret number. We give feedback to the user if their guess is too low or too high. If they guess the number right, we congratulate them and exit the loop using the break statement. If they exhaust all 5 guesses, we inform them that the game is over and reveal the secret number.


About

It is a number-guessing game written in Python. The basic idea is to have the computer produce a random number between 1 and 100 and then have the user try to guess it.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages