# Created by sarathkaul on 12/11/19def 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 sentencefor alpha in input_str:if "a" <= alpha.lower() <= "z":frequency.add(alpha.lower())return True if len(frequency) == 26 else Falseif __name__ == "main":check_str = "INPUT STRING"status = check_pangram(check_str)print(f"{check_str} is {'not ' if status else ''}a pangram string")
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。