LearnPy Hub
← Recursion & Lambda problems
Medium

Palindrome by Recursion

Write a recursive is_pal(s): a string is a palindrome if its first and last characters match and the middle is a palindrome. Read a word and print True or False.

Input

One word.

Output

True or False.

Sample 1

Input
racecar
Output
True

Sample 2

Input
python
Output
False
solution.py
Output appears here
Palindrome by Recursion · Python practice problem · LearnPy Hub