← Back to challenges

Is the String a Palindrome?

PythonHardstringsvalidationloopsinterview

Instructions

A palindrome is a word that is identical forward and backwards.

  • mom
  • racecar
  • kayak

Given a word, create a function that checks whether it is a palindrome.

Examples

is_palindrome("mom") ➞ True

is_palindrome("scary") ➞ False

is_palindrome("reviver") ➞ True

is_palindrome("stressed") ➞ False

Notes

All test input is lower cased.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: List of Consecutive Numbers