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")
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")
recursive python program to print numbers from n to 1
# Read the input
n = int(input())
def rec(n):
if n==0:
print(0)
else:
print(-n)
rec(n-1)
print(n)
rec(n)
python 3 numbers of a range is even
def check(element):
return all(ord(i)%2 == 0 for i in element) # all returns True if all digits i is even in element
lst = [str(i) for i in range(1000,3001)] # creates list of all given numbers with string data type
lst = list(filter(check,lst)) # filter removes element from list if check condition fails
print(",".join(lst))
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