Challenge 3: Check Palindrome

Given a string, check whether it is a palindrome or not.

Problem Statement

Write a function that takes a variable testVariable containing a string, and checks whether it is a palindrome or not.

What is a “Palindrome”?

A Palindrome is a string that reads the same backward and forwards.

For example madammadam, poppop, etc. Also, all strings with length 11 are palindromes.

Remember, lower case letters are different from upper case letters, therefore, AdaAda is not a palindrome.

Input

A variable testVariable containing a string.

Output

True, if the input string is a palindrome or False, if the string is not a palindrome.

Sample Input

"madam"

Sample Output

True

Try it Yourself

Try to attempt this challenge by yourself before moving on to the solution. Good luck!

Press + to interact
def isPalindrome(testVariable) :
# Write your code here
return None

Let’s have a look at the solution review of this problem.