Skip to content

Commit fd77905

Browse files
committed
Update isogram.py
1 parent c8089b2 commit fd77905

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

isogram/isogram.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,9 @@ def is_isogram(string: str) -> bool:
3131
:returns: True if the string is an isogram, False otherwise
3232
:rtype: bool
3333
"""
34+
# empty string
35+
if not string:
36+
return True
37+
3438
letters: list[str] = [char for char in string.lower() if char.isalpha()]
35-
return len(letters) == set(letters)
39+
return len(letters) == len(set(letters))

0 commit comments

Comments
 (0)