COMPUTER SCIENCE
PROJECT –
GUESS THAT RANDOM
NUMBER
BY
JAYADEEPAN J
XII C2
Introduction
Welcome to the Python Number Guessing Game. This simple yet
engaging game is designed to help users practice their coding skills,
understand basic algorithms, and have fun while learning. The game
asks users to guess a number between 1 and 100, offering feedback
along the way to guide them closer to the correct answer.
Objective
The primary objective of this project is to create an interactive
number guessing game using Python. The game aims to:
1. Enhance problem-solving skills.
2. Familiarize users with Python programming concepts like loops,
conditionals, and user input.
3. Demonstrate the use of random number generation in Python.
4. Provide a fun and engaging way to practice coding.
Tools used
https://www.programiz.com/python-programming/online-compiler/
Game Design
We are going to choose a random number using the random module in
python and also the user is continuously will be asked to give their
guess using for loops and using simple if statements, a comment is
given by the program like if their guess is correct, then they win else
in the 3rd chance a hint will be given other than this a text ‘Good guess’
is given if the user’s guess is closer to the random number, after each
guess the comment whether the guess is correct or not is displayed
and the end of the 5th chance the random number is displayed.
Implementation
Explanation
Choosing than random number
Setting the no of chances and the nearest tens of the
random number as limit for a good guess and hint.
Getting input from the user for
5 timesAfter this it is just a bunch of if-elif statements for wining,
good guess, hint, you lost and wrong guess respectively...
Output
Conclusion
The Python Number Guessing Game serves as an excellent project for
beginners and intermediate programmers alike. By completing this
project, one can gain a deeper understanding of how to structure
programs, handle user input, and implement logic to create an
interactive application. This project not only reinforces fundamental
programming skills but also showcases the versatility and simplicity of
Python as a programming language.