python odd code example
Example 1: odd or even python
num = int(input("Enter a number: "))
if (num % 2) == 0:
print("{0} is Even".format(num))
else:
print("{0} is Odd".format(num))
Example 2: program to find even numbers in python
m = int(input("Enter number"))
if m % 2 == 0:
print(m,"is an even number")
else:
print(m,"is an odd number")
Example 3: check odd numbers numpy
arr = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
arr[arr % 2 == 1]
Example 4: how to know if the numbers is par in python
if num % 2 == 0:
pass
else:
pass
Example 5: python even or odd
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')