Professional Documents
Culture Documents
Kendriya Vidyalaya I.I.T Chennai: Computer Science Group Project
Kendriya Vidyalaya I.I.T Chennai: Computer Science Group Project
I.I.T Chennai
Vikhram(
Sai Siddharth(
XI-B
Abstract:
This Python Program is based upon a real life toy called
Magic 8 Ball. It is known for providing whimsical and
mysterious answers to yes-or-no questions. The core
functionality involves generating random responses from a
predefined set of classic Magic 8-Ball answers, ensuring a
dynamic and unpredictable outcome for each inquiry.
Source Code:
print("Welcome to Fortune teller")
print('')
print('')
if info==1:
print('This Python program is based on real life toy called Magic 8 Ball.')
print('')
print('')
print('The outer shell of the Magic 8-Ball is made of black plastic and is
spherical in shape.')
print('')
print('Inside the ball is a 20-sided die with various answers written on its
faces.')
print('')
print( 'To use the Magic 8-Ball, a person asks a yes-or-no question, shakes
the ball, and then looks through a clear window on the bottom to reveal one of
the 20 responses.')
print('')
print('')
print('')
print('')
print(' The Magic 8-Ball is meant for entertainment purposes only, and its
responses are random. It does not have any actual ability to predict the
future.')
print('')
print(' Over the years, there have been different variations of the Magic 8-
Ball, including themed versions for different movies, TV shows, and
occasions.')
print('')
elif info==2:
print('')
print('')
print('')
name=input("Enter your name: ")
print('')
print("Hello", name)
print('')
luck=int(input("Wanna check you fortune? enter 1 for yes, enter 2 for no: "))
print('')
if luck==1:
else:
while True:
print('')
print('')
answer=randint(1,20)
if question!='q':
print('')
sleep(3)
if question=="q":
sleep(5)
exit()
if answer==1:
elif answer==2:
elif answer==3:
print("Without a doubt.👌")
elif answer==4:
print("Yes definitely.💯")
elif answer==5:
elif answer==6:
elif answer==7:
print("Most likely.🤔")
elif answer==8:
print("Outlook good.🌟")
elif answer==9:
print("Yes.😊")
elif answer==10:
elif answer==11:
elif answer==12:
elif answer==13:
elif answer==14:
elif answer==15:
elif answer==16:
elif answer==17:
elif answer==18:
elif answer==19:
elif answer==20:
print("Very doubtful.🤨")
Output: