MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / is_pangram_faster

Function is_pangram_faster

strings/is_pangram.py:35–56  ·  view source on GitHub ↗

>>> is_pangram_faster("The quick brown fox jumps over the lazy dog") True >>> is_pangram_faster("Waltz, bad nymph, for quick jigs vex.") True >>> is_pangram_faster("Jived fox nymph grabs quick waltz.") True >>> is_pangram_faster("The quick brown fox jumps over the la_y d

(
    input_str: str = "The quick brown fox jumps over the lazy dog",
)

Source from the content-addressed store, hash-verified

33
34
35def is_pangram_faster(
36 input_str: str = "The quick brown fox jumps over the lazy dog",
37) -> bool:
38 """
39 >>> is_pangram_faster("The quick brown fox jumps over the lazy dog")
40 True
41 >>> is_pangram_faster("Waltz, bad nymph, for quick jigs vex.")
42 True
43 >>> is_pangram_faster("Jived fox nymph grabs quick waltz.")
44 True
45 >>> is_pangram_faster("The quick brown fox jumps over the la_y dog")
46 False
47 >>> is_pangram_faster()
48 True
49 """
50 flag = [False] * 26
51 for char in input_str:
52 if char.islower():
53 flag[ord(char) - 97] = True
54 elif char.isupper():
55 flag[ord(char) - 65] = True
56 return all(flag)
57
58
59def is_pangram_fastest(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected