mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-11 15:11:26 +08:00
Set the Python file maximum line length to 88 characters (#2122)
* flake8 --max-line-length=88 * fixup! Format Python code with psf/black push Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -14,8 +14,8 @@ def is_palindrome(s: str) -> bool:
|
||||
>>> is_palindrome("Mr. Owl ate my metal worm?")
|
||||
True
|
||||
"""
|
||||
# Since Punctuation, capitalization, and spaces are usually ignored while checking Palindrome,
|
||||
# we first remove them from our string.
|
||||
# Since Punctuation, capitalization, and spaces are usually ignored while checking
|
||||
# Palindrome, we first remove them from our string.
|
||||
s = "".join([character for character in s.lower() if character.isalnum()])
|
||||
return s == s[::-1]
|
||||
|
||||
|
Reference in New Issue
Block a user