Classic palindrome phrase
Input
is_palindrome('A man, a plan, a canal: Panama')
Output
True
Ignoring non-alphanumeric characters and case, the string becomes 'amanaplanacanalpanama', which is the same forwards and backwards.
Full lesson preview
Determine whether a string is a palindrome using explicit loops and ignoring non-alphanumeric characters.
Problem statement
Task
Examples
Input
is_palindrome('A man, a plan, a canal: Panama')
Output
True
Ignoring non-alphanumeric characters and case, the string becomes 'amanaplanacanalpanama', which is the same forwards and backwards.
Input format
Output format
Constraints
Samples
Input
is_palindrome('Racecar')
Output
True
Case-insensitive palindrome.