Write a python program which takes a number from the user and prints if it is positive, negative or 0, odd or even and if it is a multiple of 10.
Example 1:
Sample Input:
-70
Sample Output:
Negative even number which is a multiple of 10
Example 2:
Sample Input:
Sample Output:
Input is 0
Example 3:
Sample Input:
11
Sample Output:
Positive odd number which is not a multiple of 10
number=float(input("Enter a number: "))
if number > 0:
print("Positive",end=" ")
elif number < 0:
print("Negative",end=" ")
else:
Input='0'
if number % 2==0 and number!=0:
print("even number",end=" ")
elif number % 2!=0:
print("odd number",end=" ")
else:
Input='0'
if number % 10==0 and number !=0:
print(" which is a multiple of 10")
elif number % 10 !=0:
print(" which is not a multiple of 10")
else:
print("Input is 0")
Comments
Leave a comment