Coders Packet

Number Guessing Game using Python

By Archisman Bhattacharya

This is a simple number guessing game written in python. The code uses the random module, the OS module, and the math module of python 3.

Version and Modules used:

Python 3

Random module

Os module

Math module


The code first generates a random number between 1-1000. It then asks the player to guess.

Every time the player guesses incorrectly, a single clue is displayed to him/her. The clues reveal the number of digits, some of the factors of the number, All the digits in the number, etc.

The player gets 6 attempts to guess the number. If the player fails to guess the answer then they get zero points else they get the number of points according to the number of clues they used.

Once the game is over, the code uses the OS module to clear the screen and start the game again if the player wants to play again. The game continues until the player wants to quit playing.


This game is designed to be run on the command prompt.

Download Complete Code


No comments yet