
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
Program to check given string is pangram or not in Python
Suppose we have a string s, this is representing a sentence, we have to check whether every letter of the English alphabet is used at least once or not.
So, if the input is like "The grumpy wizards make toxic brew, for the evil queen and Jack", then the output will be True
To solve this, we will follow these steps −
- s:= make all letters of s into lowercase letters
- a:= 0
- for each i in English alphabet, do
- if i is not in s, then
- return False
- if i is not in s, then
- return True
Let us see the following implementation to get better understanding −
Example
import string class Solution: def solve(self, s): s=s.lower() a=0 for i in string.ascii_lowercase : if i not in s : return False return True s = "The grumpy wizards make toxic brew, for the evil queen and Jack" ob = Solution() print(ob.solve(s))
Input
"The grumpy wizards make toxic brew, for the evil queen and Jack"
Output
True
- Related Articles
- Swift program to check if string is pangram or not
- Python program to check if the given string is pangram
- Program to check whether the sentence is pangram or not using Python
- Java Program to Check Whether the Given String is Pangram
- Golang Program to Check Whether the Given String is Pangram
- Python program to check if the string is pangram
- Python program to check whether a given string is Heterogram or not
- Python program to check if a given string is Keyword or not
- Program to check given string is anagram of palindromic or not in Python
- Java program to check if string is pangram
- Program to check the string is repeating string or not in Python
- C++ program to check whether given string is bad or not
- Golang Program to check the given string is empty or not
- Python - Check if a given string is binary string or not
- Program to check a string is palindrome or not in Python

Advertisements