Как найти, если значение равно или странно в Python
num = int(input("Enter a Number:"))
if num % 2 == 0:
print(num , "is even")
else:
print(num , "is odd")
Da Skeptical
num = int(input("Enter a Number:"))
if num % 2 == 0:
print(num , "is even")
else:
print(num , "is odd")
num = int(input("Enter a number: "))
if (num % 2) == 0:
print("{0} is Even number".format(num))
else:
print("{0} is Odd number".format(num))
n = int(input("Enter a number: "))
print(n,"is Even.") if (n % 2) == 0 else print(n,"is Odd.")
num = int(input("Enter a number: "))
if (num % 2) == 0:
print("{0} is Even".format(num))
else:
print("{0} is Odd".format(num))
n = int(input("Enter a number: "))
print(["even","odd"][n % 2])
injd = int(input('Enter a number'))
n = injd % 2
if n > 0:
print('This is an odd number')
else:
print('This is an even number')