Exercise · Strings · lesson 10 of 10
Exercise: palindrome
Write a function is_palindrome(text) that returns True if the string text is a palindrome and False otherwise. A palindrome reads the same from left to right and from right to left, ignoring letter case and spaces.
is_palindrome("Racecar")→Trueis_palindrome("never odd or even")→Trueis_palindrome("python")→False
Constraints: text consists of Latin or Russian letters and spaces; the empty string is a palindrome.
Do not add extra imports unless the task says so explicitly.
Subscribe to take the course
The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.