0
Guys, can anyone solve this question for me using python .
Write a Python program that displays a message as follows for a given number: If it is a multiple of 3, display "Zip" If it is a multiple of 5, display "Zap" If it is a multiple of both 3Â and 5, display "Zoom" If it does not satisfy any of the above given conditions, display "Invalid"
4 Answers
+ 5
It's just like FizzBuzz
So I will request you to give us your try (atleast), so that we can see where you were wrongđ.
Without your try or attempt towards code problem we ain't gonna give you the solution đ.
https://www.sololearn.com/discuss/1316935/?ref=app
+ 2
Your logic is good and right but if you want the output as given in the description so you have to change the prompt while giving output like if the number is divisible by 3 and 5 so it will print 'Zoom' not 'zoom'...And so on
Here is your corrected code (I just changed the prompts, nothing else)
//
a=int(input())
if a % 3 == 0 and a % 5 == 0:
print ("Zoom")
elif a % 3 == 0:
print("Zip")
elif a % 5 == 0:
print("Zap")
else:
print("Invalid")
+ 1
Thanks buddy, I will surely give a tryđ€
+ 1
a=int(input())
if a % 3 == 0 and a % 5 == 0:
print ("zoom")
elif a % 3 == 0:
print("Zip")
elif a % 5 == 0:
print("zap")
else:
print(" Invalid number")