Skip to content

Commit dd1eb27

Browse files
authored
Refactor pangram check to use set comparison
1 parent deab96b commit dd1eb27

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

strings/check_pangram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def check_pangram(input_str: str) -> bool:
1111
>>> check_pangram("")
1212
False
1313
"""
14-
return len(set(c for c in input_str.lower() if c.isalpha())) == 26
14+
return {c for c in input_str.lower() if c.isalpha()} == set("abcdefghijklmnopqrstuvwxyz")
1515

1616

1717
if __name__ == "__main__":

0 commit comments

Comments
 (0)