diff --git a/web_view.py b/web_view.py index f15d95f..f72aff1 100755 --- a/web_view.py +++ b/web_view.py @@ -132,7 +132,27 @@ def index() -> str | Response: def case_flip(s: str) -> str: - """Switch case of character.""" + """ + Switch the case of a single character. + + If the character is lowercase, it is converted to uppercase. If it is uppercase, + it is converted to lowercase. Non-alphabetic characters remain unchanged. + + Args: + s (str): A single character string. + + Returns: + str: The character with its case flipped, or the original character if it's + not a letter. + + Example: + >>> case_flip('a') + 'A' + >>> case_flip('A') + 'a' + >>> case_flip('1') + '1' + """ if s.islower(): return s.upper() if s.isupper():