diff --git a/strings/is_isogram.py b/strings/is_isogram.py index 4a80caad6d0e..b575427c0417 100644 --- a/strings/is_isogram.py +++ b/strings/is_isogram.py @@ -11,10 +11,26 @@ def is_isogram(string: str) -> bool: True >>> is_isogram('allowance') False + >>> is_isogram('') + True + >>> is_isogram('a') + True + >>> is_isogram('Alphabet') + False + >>> is_isogram('subdermatoglyphic') + True >>> is_isogram('copy1') Traceback (most recent call last): ... ValueError: String must only contain alphabetic characters. + >>> is_isogram('hello world') + Traceback (most recent call last): + ... + ValueError: String must only contain alphabetic characters. + >>> is_isogram('isogram!') + Traceback (most recent call last): + ... + ValueError: String must only contain alphabetic characters. """ if not all(x.isalpha() for x in string): raise ValueError("String must only contain alphabetic characters.")