Advertisement
1sairandhri

pangram

Mar 31st, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. def checkPangram(s):
  2.     bucket = []
  3.     # create list of 26 charecters and set false each entry
  4.     for i in range(26):
  5.         bucket.append(False)
  6.          
  7.     # converting the sentence to lowercase and iterating over the sentence  
  8.     for c in s.lower():  
  9.         if not c == " ":
  10.             bucket[ord(c) -ord('a')]= True
  11.     return True if all(bucket) else False
  12.  
  13. sentence = "The quick brown fox jumps over the little lazy dog"
  14.  
  15. print(checkPangram(sentence))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement