Python program to check whether a number is even or odd
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))
Python program to check whether a number is even or odd
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))
print even numbers in python
# Print even numbers python
lower_limit = 0
max_limit = 100
for i in range(lower_limit, max_limit):
if i%2 == 0: # even numbers are divisible by 2. i%2 will give the remainder when i is divided by 2. if i is even, the remainder will always be 2.
print(i)
#
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us