2019-11-14 10:22:08 +00:00
|
|
|
# Created by sarathkaul on 12/11/19
|
|
|
|
|
|
|
|
|
2020-04-07 12:08:11 +00:00
|
|
|
def check_pangram(
|
2019-11-14 10:22:08 +00:00
|
|
|
input_str: str = "The quick brown fox jumps over the lazy dog",
|
|
|
|
) -> bool:
|
|
|
|
"""
|
2020-04-07 12:08:11 +00:00
|
|
|
A Pangram String contains all the alphabets at least once.
|
|
|
|
>>> check_pangram("The quick brown fox jumps over the lazy dog")
|
2019-11-14 10:22:08 +00:00
|
|
|
True
|
2020-04-07 12:08:11 +00:00
|
|
|
>>> check_pangram("My name is Unknown")
|
2019-11-14 10:22:08 +00:00
|
|
|
False
|
2020-04-07 12:08:11 +00:00
|
|
|
>>> check_pangram("The quick brown fox jumps over the la_y dog")
|
2019-11-14 10:22:08 +00:00
|
|
|
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"
|
2020-04-07 12:08:11 +00:00
|
|
|
status = check_pangram(check_str)
|
|
|
|
print(f"{check_str} is {'not ' if status else ''}a pangram string")
|