Q: A pangram is a sentence that contains all the letters of the English alphabet at least once, for example: The quick brown fox jumps over the lazy dog. Your task here is to write a function to check a sentence to see if it is a pangram or not.
What I have is:
def isPangram(s):
alphabetList = 'abcdefghijklmnopqrstuvwxyz'
alphabetCount = 0
if len(s) < 26:
return False
else:
s = re.sub('[^a-zA-Z]','',s).lower()
for i in range(len(alphabetList)):
if alphabetList[i] in s:
alphabetCount = alphabetCount + 1
if alphabetCount == 26:
return True
else:
return False
However, when I try the example s=["The quick brown fox jumps over the lazy dog"], the result is False, which is wrong. It should be True b/c it has contained all 26 letters. Can anyone help me fix the code? Many thanks!!!