Skip to content

Commit 9a7f92e

Browse files
authored
Create check_pangram.py (TheAlgorithms#4389)
1 parent 4bd800a commit 9a7f92e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: strings/check_pangram.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ def check_pangram_faster(
3838
"""
3939
>>> check_pangram_faster("The quick brown fox jumps over the lazy dog")
4040
True
41-
>>> check_pangram("Waltz, bad nymph, for quick jigs vex.")
41+
>>> check_pangram_faster("Waltz, bad nymph, for quick jigs vex.")
4242
True
43-
>>> check_pangram("Jived fox nymph grabs quick waltz.")
43+
>>> check_pangram_faster("Jived fox nymph grabs quick waltz.")
4444
True
4545
>>> check_pangram_faster("The quick brown fox jumps over the la_y dog")
4646
False
@@ -50,7 +50,9 @@ def check_pangram_faster(
5050
flag = [False] * 26
5151
for char in input_str:
5252
if char.islower():
53-
flag[ord(char) - ord("a")] = True
53+
flag[ord(char) - 97] = True
54+
elif char.isupper():
55+
flag[ord(char) - 65] = True
5456
return all(flag)
5557

5658

0 commit comments

Comments
 (0)