RosettaCodeData/Task/Palindrome-detection/Python/palindrome-detection-4.py

3 lines
87 B
Python
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
def is_palindrome_r2(s):
return not s or s[0] == s[-1] and is_palindrome_r2(s[1:-1])