Loading...
Loading...
Loading...
Write a recursive function that tells whether a word reads the same forwards and backwards. Print yes or no.
yes if the word is a palindrome, otherwise no.Example 1
Input
level
Output
yes
A palindrome.
Example 2
Input
market
Output
no
Not a palindrome.
Try the problem first. Open one hint at a time.
Compare the first and last letters.
If they match, check the letters between them.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor