Ответ:
def is_palindrome(n):
return str(n) == str(n)[::-1]
A, B = map(int, input().split())
found_palindrome = False
for i in range(A, B + 1):
if is_palindrome(i):
print(i, end=' ')
found_palindrome = True
if not found_palindrome:
print(-1)
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Ответ:
def is_palindrome(n):
return str(n) == str(n)[::-1]
A, B = map(int, input().split())
found_palindrome = False
for i in range(A, B + 1):
if is_palindrome(i):
print(i, end=' ')
found_palindrome = True
if not found_palindrome:
print(-1)