You are on page 1of 3

Name: Vaishnavi Vhatkar

S.Y.I.T-D: 6459
PYTHON PROJECT
TOPIC: GUESSING GAME

GAME CODE:

import random
n=random.randint(1,99)
print(' ')
print(' ')
print('The game will be randomly choosing numbers from 1 to 99.')
print(' ')
print('Guess the number chosen by the game.')
print(' ')
guess=int(input('Enter your guess from 1 to 99: '))
while n!='guess':
print
if guess<n:
print(' ')
print('Guessed number is smaller than the actual number!')
print(' ')
guess=int(input("Enter your guess again: "))
elif guess>n:
print(' ')
print('Guessed number is higher than the actual number!')
print(' ')
guess=int(input("Enter your guess again: "))
Name: Vaishnavi Vhatkar
S.Y.I.T-D: 6459
else:
print(' ')
print('Perfect guess!')
break
print

OUTPUT:
Name: Vaishnavi Vhatkar
S.Y.I.T-D: 6459

You might also like