Python program for Zip, Zap and Zoom game

31-Oct-2022

.

Admin

Python program for Zip, Zap and Zoom game

Hi Dev,

In this tutorial, you will learn Python program for Zip. This article goes in detailed on Zap and Zoom game. we will help you to give example of Zip. This tutorial will give you simple example of Zap and Zoom game in Python Example.

Python program for Zip, Zap and Zoom game; In this tutorial, you will learn how to create zip zap zoom python program.

let's see below simple example with output:

What does mean by zip zap zoom in python program?


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: Write a python program that displays zip zap zoom.

# Python program for Zip, Zap and Zoom game

def myFunc(Num):

if Num % 3 == 0 and Num % 5 == 0 :

return "Zoom"

elif Num % 3 == 0 :

return "Zip"

elif Num % 5 == 0 :

return "Zap"

else :

return "invalid"

#take input from user

n=int(input("Enter any number to find zip, zap, zoom :- "))

#call calSum() function and print result

print("The entered number is :- " ,

myFunc(n))

Output:

Enter any number to find zip, zap, zoom :- 3

The entered number is :- Zip

I hope it can help you...

#Python