[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2023-10-01 08:03:15 +00:00
parent 02ff53c1e8
commit a696268791

View File

@ -16,6 +16,7 @@ def is_upper(string: str) -> bool:
"""
return all(ord(char) >= 65 and ord(char) <= 90 for char in string)
def is_lower(string: str) -> bool:
"""
Check if all characters in the string are lowercase letters.
@ -34,6 +35,7 @@ def is_lower(string: str) -> bool:
"""
return all(ord(char) >= 97 and ord(char) <= 122 for char in string)
def is_alpha(string: str) -> bool:
"""
Check if all characters in the string are alphabetical (letters).
@ -52,6 +54,7 @@ def is_alpha(string: str) -> bool:
"""
return all(char.isalpha() for char in string)
def is_alnum(string: str) -> bool:
"""
Check if all characters in the string are alphanumeric (letters or digits).
@ -70,6 +73,7 @@ def is_alnum(string: str) -> bool:
"""
return all(char.isalnum() for char in string)
def is_decimal(string: str) -> bool:
"""
Check if all characters in the string are decimal digits.
@ -88,6 +92,7 @@ def is_decimal(string: str) -> bool:
"""
return all(char.isdigit() for char in string)
def is_space(string: str) -> bool:
"""
Check if all characters in the string are whitespace characters.
@ -106,6 +111,7 @@ def is_space(string: str) -> bool:
"""
return all(char.isspace() for char in string)
def is_title(string: str) -> bool:
"""
Check if the string is in title case (first letter of each word is capital).
@ -124,6 +130,8 @@ def is_title(string: str) -> bool:
"""
return string.istitle()
if __name__ == "__main__":
import doctest
doctest.testmod()