Write a program in Python to create a list of 20 integers. Now display all the even integers along with their position in a list. code example
Example 1: python 3 numbers of a range is even
lst = []
for i in range(1000,3001):
flag = 1
for j in str(i):
if ord(j)%2 != 0:
flag = 0
if flag == 1:
lst.append(str(i))
print(",".join(lst))
Example 2: python 3 numbers of a range is even
def check(element):
return all(ord(i)%2 == 0 for i in element)
lst = [str(i) for i in range(1000,3001)]
lst = list(filter(check,lst))
print(",".join(lst))