num = 1 while num <= 1000: if num < 10: print(num) elif num > 9 and num < 100: if num % 11 == 0: print(num) else: a = num // 100 b = num % 10 if a == b: print(num) num += 1;