Skip to content

Instantly share code, notes, and snippets.

@TApicella
Created May 16, 2017 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TApicella/62fe5743acd392aeb1e32a210aff74e8 to your computer and use it in GitHub Desktop.
Save TApicella/62fe5743acd392aeb1e32a210aff74e8 to your computer and use it in GitHub Desktop.
RosettaCode- pangram checker created by tapicella - https://repl.it/IBRL/3
'''
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.
Task
Write a function or method to check a sentence to see if it is a pangram (or not) and show its use.
'''
import string
def isPangram(mystring):
is_p = True
mystring = mystring.lower()
for c in string.ascii_lowercase:
if c not in mystring:
is_p=False
break
return is_p
print(isPangram("The quick brown fox jumps over the lazy dog."))
print(isPangram("The quick brown fox jumps over the slow dog."))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment