Advertisement
T-D-K

Untitled

May 3rd, 2018
250
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) // 2):
  6.         if (s[j] != s[len(s) -1 - j]):
  7.             break
  8.     else:
  9.         a = a +1
  10. print(a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement