check pangram Algorithm
It is normally used for touch-typing practice, testing typewriters and computer keyboards, displaying examples of fonts, and"The quick brown fox jumps over the lazy dog" is an English-language pangram — a sentence that contains all of the letters of the alphabet. The first message send on the Moscow – Washington hotline on August 30, 1963, was the test phrase" THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG'S BACK 1234567890".
As the purpose of typewriters grew in the late 19th century, the phrase begin appearing in typing lesson books as a practice sentence. In an article titled" current note" in the February 9, 1885, version, the phrase is noted as a good practice sentence for write students:" A favorite copy put by write teachers for their pupils is the following, because it contains every letter of the alphabet:' A quick brown fox jumps over the lazy dog.'
# Created by sarathkaul on 12/11/19
def check_pangram(
input_str: str = "The quick brown fox jumps over the lazy dog",
) -> bool:
"""
A Pangram String contains all the alphabets at least once.
>>> check_pangram("The quick brown fox jumps over the lazy dog")
True
>>> check_pangram("My name is Unknown")
False
>>> check_pangram("The quick brown fox jumps over the la_y dog")
False
"""
frequency = set()
input_str = input_str.replace(
" ", ""
) # Replacing all the Whitespaces in our sentence
for alpha in input_str:
if "a" <= alpha.lower() <= "z":
frequency.add(alpha.lower())
return True if len(frequency) == 26 else False
if __name__ == "main":
check_str = "INPUT STRING"
status = check_pangram(check_str)
print(f"{check_str} is {'not ' if status else ''}a pangram string")