BEstyle 2022. 10. 7. 19:22

DESCRIPTION:

A pangram is a sentence that contains every single letter of the alphabet at least once. For example, the sentence "The quick brown fox jumps over the lazy dog" is a pangram, because it uses the letters A-Z at least once (case is irrelevant).

Given a string, detect whether or not it is a pangram. Return True if it is, False if not. Ignore numbers and punctuation.

 


 

def is_pangram(s):
    s=s.lower() #97 122
    slist=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
    for i in s:
        if ord(i)>=97 and ord(i)<=122:
            slist[ord(i)-97]+=1
    return 0 not in slist