Enter a no if that no is not divisible by 2 display ODD.IF divisible by 2 then check if the no is divisible by 5,display valid otherwise display even
Answers
Answered by
2
Python Program of the Above Question Is As Follows:-
n = int(input("Enter The Number:- "))
if n%2 == 0:
print("Even")
else:
print("Odd")
if n%5 == 0:
print("Valid")
if n%5 != 0:
print("Even")
Menu - Based Program:-
while True:
n = int(input("Enter The Number:- "))
if n%2==0:
print("Even")
if n%5 == 0:
print("valid")
if n%2 != 0:
print("Odd")
if n%5 != 0:
print("Even")
a = input("Want to Run The Program Again y/n?")
if a.lower() == "n":
break
Similar questions