xxxxxxxxxx
a = int(input("Enter the number to find odd or even "))
if (a % 2) == 0:
print("{0} is Even".format(a))
else:
print("{0} is Odd".format(a))
xxxxxxxxxx
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))
xxxxxxxxxx
mynumber = int(input("Enter number")) # Ask an integer number to the user
if mynumber % 2 == 0: # % = modelo, It is equal to the rest of the division
print(mynumber, "is an even number")
else: # The rest of 7 / 2 is 2.5, not 0
print(mynumber, "is an odd number")
xxxxxxxxxx
number = int(input("Write a number:- "))
if number%2 == 0:
print("Even number")
else:
print("odd number")
xxxxxxxxxx
num = int(input("Enter a number: "))
if (num % 2) == 0:
print("{0} is Even".format(num))
else:
print("{0} is Odd".format(num))
xxxxxxxxxx
num = int(input("Enter a number: "))
if (num % 2) == 0:
print(num ,"is even number\n")
#CODE BY VENOM STONE
else:
print(num,"is Odd number\n")
#CODE BY VENOM STONE
xxxxxxxxxx
num = int(input("Enter a number: "))
if (num % 2) == 0:
print("{0} is Even".format(num))
else:
print("{0} is Odd".format(num))
xxxxxxxxxx
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')
xxxxxxxxxx
count2 = 0
for odd_number in range(1, 20):
if odd_number % 2 != 0:
count2 += 1
print(odd_number)
print(f"we have {count2} odd numbers")
xxxxxxxxxx
>>> def isodd(num):
return num & 1 and True or False
>>> isodd(10)
False
>>> isodd(9)
True