1lst = []
2
3for i in range(1000,3001):
4 flag = 1
5 for j in str(i): # every integer number i is converted into string
6 if ord(j)%2 != 0: # ord returns ASCII value and j is every digit of i
7 flag = 0 # flag becomes zero if any odd digit found
8 if flag == 1:
9 lst.append(str(i)) # i is stored in list as string
10
11print(",".join(lst))
1def check(element):
2 return all(ord(i)%2 == 0 for i in element) # all returns True if all digits i is even in element
3
4lst = [str(i) for i in range(1000,3001)] # creates list of all given numbers with string data type
5lst = list(filter(check,lst)) # filter removes element from list if check condition fails
6print(",".join(lst))