X=0
n=100
while n<1000:<br> if str(n)[:1]==str(n)[-1] and n%3==0:
x+=n
n+=1
print(x)
Результат выполнения программы:
Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:15:05) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
16803
>>>