Python Program which will find all such numbers between 1000 and 3000 (both included) such that each digit of the number is an even number.The numbers obtained should be printed in a comma-separated sequence on a single line
x=''
for i in range (1000,3001):
n=i
flag =1
while (n>0):
rem = n%10
if (rem%2!=0):
flag = 0
break
n=n//10
if (flag == 1):
x+= str(i)+' , '
print (x)
Comments
Post a Comment