0
380views
Write a python program to implement is Palindrome () function to check given string is palindrome or not.
1 Answer
written 23 months ago by |
Solution:
A palindrome is a string that is the same read forward or backward.
For example, "noon" is the same in the forward or reverse direction.
Another an example is "dkjcbdvafkhr", which means, an irritable fear of palindromes.
Palindrome algorithm:
Read the number or letter.
Hold the letter or number in a temporary variable.
Reverse the letter or number.
Compare the temporary variable with the reversed letter or number.
If both letters or numbers are the same, print "this string/number is a palindrome."
Else print, "this string/number is not a palindrome."
Input:
Output: