
- 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
Python program to check if the given string is pangram
In this article, we will learn about the solution and approach to solve the given problem statement.
Problem statement
Given a string input, we need to generate a Python program to check whether that string is Pangram or not.
A pangram is a sentence/ series of words which contains every letter in the English Alphabets collection.
Now let’s see how we can solve the problem
We will use a loop that checks whether each character present in the input string belongs to the alphabet set or not which we will declare manually .
The implementation of the approach above is given by −
Example
import string def ispangram(str): alphabet = "abcdefghijklmnopqrstuvwxyz" for char in alphabet: if char not in str.lower(): return False return True # main string = 'The five boxing wizards jump quickly.' if(ispangram(string) == True): print("Yes") else: print("No")
Output
Yes
Here we implemented two for loops via membership operators in the nehaced version by specifying an iterable of type string
All variables and functions are declared in global scope as shown in the figure below.
Conclusion
In this article, we learned about the approach to find whether a string is a number pangram or not
- Related Articles
- Python program to check if the string is pangram
- Program to check given string is pangram or not in Python
- Java program to check if string is pangram
- Java Program to Check Whether the Given String is Pangram
- Golang Program to Check Whether the Given String is Pangram
- Swift program to check if string is pangram or not
- Python program to check if the given string is vowel Palindrome
- Python program to check if a given string is number Palindrome
- Program to check whether the sentence is pangram or not using Python
- Python program to check if a given string is Keyword or not
- Python Program to check if a substring is present in a given string.
- Python Program to check if the given array is Monotonic
- Python program to check if the string is empty or not
- Python program to check if the given number is Happy Number
- C Program to Check if a Given String is a Palindrome?
