Advertisement
T-D-K

Untitled

Jun 14th, 2018
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. k = int(input())
  2. a = 0
  3. for i in range(1, k + 1):
  4.     s = str(i)
  5.     for j in range(len(s)):
  6.         if s[j] != s[len(s) - j - 1]:
  7.             break
  8.     else:
  9.         a = a + 1
  10. print(a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement