Skip to content

Commit 7f0ebc9

Browse files
authored
26 return True if sentence is palindrom (#59)
1 parent fbf0b7c commit 7f0ebc9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

06/tasks/task_26_is_palindrome_sentence.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ def is_palindrome_sentence(s: str) -> bool:
44
"""
55
Vrátí True, pokud je věta palindrom (ignoruje mezery, interpunkci a velikost písmen).
66
"""
7+
# creates a list consisting only of lowercase letters of the original string
8+
s_list = [char.lower() for char in s if char.isalpha()]
79

10+
return s_list == s_list[::-1]

0 commit comments

Comments
 (0)