Friday, March 15, 2019

Palindrome using Recursion in Python

Recursion is one that calls itself.  Any loop can be represented in recursion.

Take for instance the example I wrote to check whether a word is a palindrome or not.

Palindrome is  a word, number, phrase or other sequence of characters which reads the same backward as forward such as madam, racecar or the number 10801.

See how the two functions are implemented, one using ordinary loop and one using recursion.

You can try the code and see whether the words are palindrome or not.