Python Zip Zap Zoom Game

In this python example, you will learn how to create zip zap zoom python program.

How zip zap zoom works?

  • If the number is multiple of 3, to display Zip.
  • If the number is multiple of 5, display Zap.
  • If the number is multiple of 3 and 5, display Zoom.
  • If it does not satisfy any of the above-given conditions, display Invalid.

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.


Share your thoughts

Ask anything about this examples