Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions strings/palindrome.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@
return True


def is_palindrome_traversal(s: str) -> bool:
"""
Return True if s is a palindrome otherwise return False.
def is_palindrome(s: str) -> bool:
"""Check whether a given string is a palindrome."""

>>> all(is_palindrome_traversal(key) is value for key, value in test_data.items())

Check failure on line 43 in strings/palindrome.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

strings/palindrome.py:43:7: invalid-syntax: Expected a statement

Check failure on line 43 in strings/palindrome.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

strings/palindrome.py:43:5: invalid-syntax: Expected a statement
True
"""
end = len(s) // 2
Expand All @@ -58,9 +57,9 @@

def is_palindrome_recursive(s: str) -> bool:
"""
Return True if s is a palindrome otherwise return False.

Check failure on line 60 in strings/palindrome.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

strings/palindrome.py:60:48: invalid-syntax: Simple statements must be separated by newlines or semicolons

Check failure on line 60 in strings/palindrome.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

strings/palindrome.py:60:38: invalid-syntax: Simple statements must be separated by newlines or semicolons

Check failure on line 60 in strings/palindrome.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

strings/palindrome.py:60:27: invalid-syntax: Expected `else`, found name

Check failure on line 60 in strings/palindrome.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

strings/palindrome.py:60:12: invalid-syntax: Simple statements must be separated by newlines or semicolons

Check failure on line 61 in strings/palindrome.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

strings/palindrome.py:60:61: invalid-syntax: Expected an identifier
>>> all(is_palindrome_recursive(key) is value for key, value in test_data.items())

Check failure on line 62 in strings/palindrome.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

strings/palindrome.py:62:7: invalid-syntax: Expected a statement

Check failure on line 62 in strings/palindrome.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

strings/palindrome.py:62:5: invalid-syntax: Expected a statement
True
"""
if len(s) <= 1:
Expand All @@ -73,7 +72,7 @@

def is_palindrome_slice(s: str) -> bool:
"""
Return True if s is a palindrome otherwise return False.

Check failure on line 75 in strings/palindrome.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

strings/palindrome.py:75:12: invalid-syntax: Simple statements must be separated by newlines or semicolons

>>> all(is_palindrome_slice(key) is value for key, value in test_data.items())
True
Expand Down
Loading