In this python example, you will learn how to create zip zap zoom python program.
Example : Zip Zap Zoom Game
# Python program for Zip, Zap and Zoom game
def Play(no):
if no % 3 == 0 and no % 5 == 0 :
return "Zoom"
elif no % 3 == 0 :
return "Zip"
elif no % 5 == 0 :
return "Zap"
else :
return "invalid"
#take input from user
n=int(input("Enter any number to find zip, zap, zoom :- "))
#Play Game
print("The entered number is :- " ,
Play(n))
Output :
Enter any number to find zip, zap, zoom :- 15
The entered number is :- Zoom
First of all we take numeric input from user and pass it to Play() function where entire game logic is perform. Based on game logic it will return response and we will print that response as output.
Ask anything about this examples