Menu Close

Panagram in Python….-FcukTheCode.com

Panagram or Pangram
A pangram or holoalphabetic sentence is a sentence using every letter of a given alphabet at least once. Pangrams have been used to display typefaces, test equipment, and develop skills in handwriting, calligraphy, and keyboarding. The best-known English pangram is”
The quick brown fox jumps over the lazy dog“.

Write a Python program to check whether the given string is Pangram or not.

Refer sample input and output for formatting specification.

Input:
The quick brown fox jumps over the lazy dog

Output:
The string is a pangram

from string import ascii_lowercase as asc_lower
def check(s):
    return set(asc_lower) - set(s.lower()) == set([])
strng=input("Enter the Sentence:  ")
if(check(strng)==True):
      print("The string is a pangram")
else:
      print("The string is not a pangram")


INPUT_1:
Enter the Sentence: The quick brown fox jumps over a lazy dog
OUTPUT:
The string is a pangram


INPUT_2:
Enter the Sentence:   The  five  boxing  wizards  jump  quickly
OUTPUT:
The string is a pangram


INPUT_3:
Enter the Sentence:   A  wizard’s  job  is  to  vex  chumps  quickly  in  fog
OUTPUT:
The string is a pangram


INPUT_4:
Enter the Sentence:   Waxy  and  quivering,  jocks  fumble  the  pizza
OUTPUT:
The string is a pangram


INPUT_5:
Enter the Sentence:   Wax  and  quivering,  jocks  fumble  the  pizza
OUTPUT:
The string is not a pangram


ILLUSTRATION

Executed using python3 linux terminal