mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-01-18 08:17:01 +00:00
Create check_pangram.py (#4389)
This commit is contained in:
parent
6f21f76696
commit
727341e3db
|
@ -38,9 +38,9 @@ def check_pangram_faster(
|
|||
"""
|
||||
>>> check_pangram_faster("The quick brown fox jumps over the lazy dog")
|
||||
True
|
||||
>>> check_pangram("Waltz, bad nymph, for quick jigs vex.")
|
||||
>>> check_pangram_faster("Waltz, bad nymph, for quick jigs vex.")
|
||||
True
|
||||
>>> check_pangram("Jived fox nymph grabs quick waltz.")
|
||||
>>> check_pangram_faster("Jived fox nymph grabs quick waltz.")
|
||||
True
|
||||
>>> check_pangram_faster("The quick brown fox jumps over the la_y dog")
|
||||
False
|
||||
|
@ -50,7 +50,9 @@ def check_pangram_faster(
|
|||
flag = [False] * 26
|
||||
for char in input_str:
|
||||
if char.islower():
|
||||
flag[ord(char) - ord("a")] = True
|
||||
flag[ord(char) - 97] = True
|
||||
elif char.isupper():
|
||||
flag[ord(char) - 65] = True
|
||||
return all(flag)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user