Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Not Very Clean but works solution in Creative category for Pangram by schanjr
# migrated from python 2.7
from collections import Counter
def check_pangram(text):
lowered=text.lower()
count=Counter()
alpha="abcdefghijklmnopqrstuvwxyz"
for let in alpha:
count[let]+=1
for letters in lowered:
count[letters]+=1
for key,values in list(count.items()):
if key.isalpha():
pass
else:
count.pop(key)
print(count)
if all(x is x>=2 for x in count.values()):
return True
else:
return False
if __name__ == '__main__':
# These "asserts" using only for self-checking and not necessary for auto-testing
assert check_pangram("The quick brown fox jumps over the lazy dog."), "brown fox"
assert not check_pangram("ABCDEF"), "ABC"
assert check_pangram("Bored? Craving a pub quiz fix? Why, just come to the Royal Oak!"), "Bored?"
Jan. 28, 2015
Comments: