0% found this document useful (0 votes)
21 views9 pages

Number Guessing

The document describes a number guessing game program written in Python. The program uses random numbers, takes user input for guessing, and provides feedback if the guess is too high or low. It allows multiple guesses and tells the user when they guess correctly.

Uploaded by

rahulshastri0126
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views9 pages

Number Guessing

The document describes a number guessing game program written in Python. The program uses random numbers, takes user input for guessing, and provides feedback if the guess is too high or low. It allows multiple guesses and tells the user when they guess correctly.

Uploaded by

rahulshastri0126
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

NUMBER GUESSING 2023-24

A PROJECT REPORT
ON

NUMBER GUESSING

As a part of the Informatics Practices Course (065)


SUBMITTED BY:
Name of the Student
1) ATUL PRAMOD
2) J VICTORIA ANAND
3) STEFFI MALIGER
4) LAVINA DEVRAJ
5) PUSHPA KUMARI
6) SHRISTI ANIL GAUTAM

Under the guidance of

SHILPA MADDI

DEPARTMENT OF INFORMATICS PRACTICES

SRI CHAITANYA TECHNO SCHOOL


SARASWATIPURAM, JAIN LAYOUT, KESHWAPUR, KUSUGAL ROAD, NEAR VRL RESIDENCE, HUBBALLI-580023, KARNATAKA

INTERNAL EXAMINER EXTERNAL EXAMINER


NUMBER GUESSING 2023-24

INDEX

SNO. CONTENTS PAGE NO.


1 ACKNOWLEDGEMENT 1
2 INTRODUCTION 2
3 SOURCE CODE 3
4 OUTPUT 5
5 HARDWARE AND SOFTWARE REQUIREMENTS 6
NUMBER GUESSING 2023-24

ACKNOWLEDGEMENT

We are grateful to our respectable teacher, SHILPA MADDI. Whose


insightful leadership and knowledge benefited us to steer out this project
successfully. Thank you for your continuing support for our important
work in this field!

We would also like to underscore the dynamic efforts of the teamwork


and their expert advice and contributions to the preparation of this report.

Regards,
ATUL PRAMOD
J VICTORIA ANAND
STEFFI MALIGER
LAVINA DEVRAJ
PUSHPA KUMARI
SHRISTI ANIL GAUTAM

1
NUMBER GUESSING 2023-24

INTRODUCTION:

ABOUT PYTHON

Python is a high level, interpreted and general purpose


dynamic programming language that focuses on code
readability. It has fewer steps when compared to Java and C.
It was founded in 1991 by developer Guido Van Rossum. It is
used in many organizations as it supports multiple
programming paradigms. It also performs automatic
memory management.
Advantages:
Open source and community development

  Easy to learn
  User-friendly data structures

  High-level language
 Portable and Interactive

There are many features in Python:


1) GUI based desktop applications(Games, Scientific
Applications)
2)Web frameworks and applications

3)Enterprise and Business applications


4)Operating Systems
5)Language Development
2
NUMBER GUESSING 2023-24

SOURCE CODE:
import random #bring in the random number

import time
number=random.randint(1, 200) #pick the number between 1 and 200

def intro():

print("May I ask you for your name?")

name=input() #asks for the name

print(name + ", we are going to play a game. I am thinking of a


number between 1 and 200")

time.sleep(.5)

print("Go ahead. Guess!")

def pick():

guessesTaken = 0

while guessesTaken < 6: #if the number of guesses is less than 6

time.sleep(.25)

enter=input("Guess: ") #inserts the place to enter guess

try: #check if a number was entered

guess = int(enter) #stores the guess as an integer instead of a


string

if guess<=200 and guess>=1: #if they are in range

guessesTaken=guessesTaken+1 #adds one guess each time


the player is wrong

3
NUMBER GUESSING 2023-24

if guessesTaken<6:

if guess<number:

print("The guess of the number that you have entered is


too low")

if guess>number:

print("The guess of the number that you have entered is


too high")

if guess != number:

time.sleep(.5)

print("Try Again!")

if guess==number:

break #if the guess is right, then we are going to jump out of
the while block

if guess>200 or guess<1: #if they aren't in the range

print("Silly Goose! That number isn't in the range!")

time.sleep(.25)

print("Please enter a number between 1 and 200")

except: #if a number wasn't entered

print("I don't think that "+enter+" is a number. Sorry")

if guess == number:

guessesTaken = str(guessesTaken)

print('Good job, ' + name + '! You guessed my number in ' +


guessesTaken + ' guesses!')

4
NUMBER GUESSING 2023-24

if guess != number:

print('Nope. The number I was thinking of was ' + str(number))

playagain="yes"

while playagain=="yes" or playagain=="y" or playagain=="Yes":

intro()

pick()

print("Do you want to play again?")

playagain=input()

5
NUMBER GUESSING 2023-24

OUTPUT:

6
NUMBER GUESSING 2023-24

HARDWARE AND SOFTWARE REQUIREMENTS :


HARDWARE REQUIREMENTS:

I.OPERATING SYSTEM : WINDOWS 7 AND ABOVE

II. PROCESSOR : PENTIUM(ANY) OR AMD

ATHALON(3800+- 4200+ DUALCORE)

III. MOTHERBOARD : 1.845 OR 915,995 FOR PENTIUM 0R MSI


K9MM-V VIAK8M800+8237R PLUS
CHIPSET FOR AMD ATHALON
IV. RAM : 512MB+
V. Hard disk : SATA 40 GB OR ABOVE

VI. CD/DVD r/w multi drive combo: (If back up required)

VII. FLOPPY DRIVE 1.44 MB : (If Backup required)

VIII. MONITOR : 14.1 or 15 -17 inch

IX. Key board and mouse

X. Printer : (if print is required – [Hard copy])

SOFTWARE REQUIREMENTS:

I. Windows OS
II. Python

Python Libraries:
Pandas, Matplotlib.

References:
Class –XII Sumitha Arora text book.

You might also like