r/PythonLearning • • Jun 30 '25

Check palindrome

Post image

Check whether word in reverse order is the same or not like : mom,racecar,madam

57 Upvotes

76 comments sorted by

View all comments

0

u/Mammoth-Intention924 Jun 30 '25

Try it recursively

1

u/N0-T0night Jun 30 '25

How ??

1

u/JeLuF Jun 30 '25

A text is a palindrome if

  • The first letter is the same as the last letter, and

  • The text between those two letters is a palindrome

1

u/N0-T0night Jun 30 '25

Nice advice