Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Pangram by Rafal.U
def check_pangram(text):
alfabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] # lista z literami alfabetu łacinskiego
text_male = text.lower() #zamienienie w stringu dużych na małe litery
list_text = list(text_male) #stworzenie listy składającej sie z liter zawartych w zdaniu podanym na wejsciu
for i in list_text: #wybieranie po kolei z listy poszczególnych liter zdania
for j in alfabet: #wybieranie z listy kolejnyc liter alfabetu
if i == j: #sprawdzenie czy kolejne litery zdania wystepuja w alfabecie
alfabet.remove(j) #usniecie litery alfabetu wystepujacej w zdaniu
if len(alfabet) == 0: #jezeli zdanie na wejsciu zawiera wszystkie litery alfabetu lacinskiego lista z literami alfabetu jest pusta
return True # i wówczas zdanie jest pangramem i i zwraca True
return False # zdanie nie jest pangramem wynik programu False
#return True or 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?"
Nov. 29, 2016