murli is attending a quiz the question contains an integer n murli gas to tell the closest number to n where all the digits of that number are even in case of a tie between two numbers choose the smallest one. write a program to find the number in python coding
def splitevenodd(A):
evenlist = []
oddlist = []
for i in A:
if (i % 2 == 0):
evenlist.append(i)
else:
oddlist.append(i)
print("Even lists:", evenlist)
print("Odd lists:", oddlist)
A = list()
n = int(input("Enter the n numbers of your list:"))
print("Enter your numbers inside the list:")
for i in range(int(n)):
k = int(input(""))
A.append(k)
splitevenodd(A)
Comments
Leave a comment