Created
May 16, 2017 17:20
-
-
Save TApicella/62fe5743acd392aeb1e32a210aff74e8 to your computer and use it in GitHub Desktop.
RosettaCode- pangram checker created by tapicella - https://repl.it/IBRL/3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
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