Sobes.tech
Junior — Senior

Palindrome string check

livecode

Task condition

Implement a function that determines whether a given string reads the same forwards and backwards. When checking, ignore case and any punctuation marks.

Requirements

  • The function takes one parameter — a string.
  • Returns true if the string is a palindrome, and false otherwise.
  • When comparing characters, case should be ignored, and all non-letter characters (spaces, commas, periods, exclamation marks, etc.) should be skipped.

Example

def is_palindrome(text: str) -> bool:
    # your code here

Usage examples

print(is_palindrome("A man, a plan, a canal: Panama"))  # True
print(is_palindrome("Hello, World!"))                 # False
Palindrome string check - Live Coding Python - sobes.tech