Computer Science, asked by Sirishakasetty, 11 months ago

*
Write a python program that displays a message as follows for a given number:
a. If it is a multiple of three, display "Zip"
b. If it is a multiple of five, display "Zap".
c. If it is a multiple of both three and five, display "Zoom".
d. If it does not satisfy any of the above given conditions, display "Invalid".
Estimated time: 20 minutes​

Answers

Answered by sswaraj04
6

Answer:

x=int(input("Enter the number"))

if x%3==0:

   if x%5==0:

       print("Zoom")

   else:

       print("Zip")

elif x%5==0:

   print("Zap")

else:

   print("Invalid")

Explanation:

now as per condn

if x is divisible by 3

then, if x is divisible by 5 too then printing zoom otherwise just Zip

now if x is divisible by 5 not by 3 then print Zap

and both case not valid then print Invalid

Hope it helps :-)

Similar questions