Tuesday, April 17, 2018

Panagram Checking Python

Tags

Practical 10:

Write a Python function to check whether a string is pangram or not. For example:
“the quick brown fox jumps over the lazy dog”. Import the package to see whether
the input string is pangram or not.
Code :
#Pangram checking
string=input("Enter String : ");
string1="The quick brown fox jumps over the lazy dog";


alphabets='abcdefghijklmnopqrstuvwxyz';
isPangram=True;
for i in alphabets:
    if(string1.lower().__contains__(i)):
        continue;
    else:
        isPangram=False;
        break;


if(isPangram):
    print("Panagram");
else:
    print("Not Panagram");
 
 
Output:
 
 
Next Practical 11:
 
Water Jug Problem