Write the Python code of a program that reads an integer, and prints the integer it is a multiple of either 2 or 5 but not both. If the number is a multiple of 2 and 5 both, then print "Multiple of 2 and 5 both
print('Enter integer: ', end='')
n = int(input())
if (n % 2 == 0) & (n % 5 == 0):
print('Multiple of 2 and 5 both')
elif (n % 2 == 0) | (n % 5 == 0):
print(n)
Comments
Leave a comment