Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. a = int(input())
  2. b = int(input())
  3. answer = []
  4. for i in range(a // 100, b // 100 + 1):
  5. f = i % 10
  6. s = i // 10
  7. first = 100 * i + f * 10 + f
  8. second = 100 * i + s * 10 + s
  9. if f == s:
  10. for j in range(10):
  11. third = 100 * i + f * 10 + j
  12. chetire = 100 * i + j * 10 + f
  13. if a < third < b:
  14. answer.append(third)
  15. if a < chetire < b:
  16. answer.append(chetire)
  17. else:
  18. if a < first < b:
  19. answer.append(first)
  20. if a < second < b:
  21. answer.append(second)
  22. answer.sort()
  23. for i in range(len(answer)):
  24. print(answer[i])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement