Given a string, check if the given string is pangram or not.
Input : The quick brown fox jumps over the lazy dog Output : The string is a pangram Input : geeks for geeks Output : The string is not pangram
A normal way would have been to use frequency table and check if all elements were present or not. But using import ascii_lowercase as asc_lower we import all the lower characters in set and all characters of string in another set. In the function, two sets are formed- one for all lower case letters and one for the letters in the string. The two sets are subtracted and if it is an empty set, the string is a pangram.
Below is Python implementation of the above approach:
The string is a pangram
- Cost to make a string Panagram | Set 2
- Cost to make a string Panagram
- String slicing in Python to check if a string can become empty by recursive deletion
- Python | Check if given string can be formed by concatenating string elements of list
- Python | Check if string ends with any string in given list
- Python | Check if a given string is binary string or not
- Python | Check for URL in a String
- Python | Check if given string is numeric or not
- Python | Check if a variable is string
- Python | Check for ASCII string
- Python | Check if string repeats itself
- Python | Check whether string contains only numbers or not
- Python Set | Check whether a given string is Heterogram or not
- Python | Check for float string
- Python | Check for spaces in string
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.