File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change 11"""
22Pangram.
33
4- You work for a company that sells fonts through their website. They'd like to show a
5- different sentence each time someone views a font on their website. To give a
6- comprehensive sense of the font, the random sentences should use all the letters
7- in the English alphabet.
4+ You work for a company that sells fonts through their website. They'd like to
5+ show a different sentence each time someone views a font on their website.
6+ To give a comprehensive sense of the font, the random sentences should use
7+ all the letters in the English alphabet.
88
9- They're running a competition to get suggestions for sentences that they can use.
10- You're in charge of checking the submissions to see if they are valid.
9+ They're running a competition to get suggestions for sentences that they can
10+ use. You're in charge of checking the submissions to see if they are valid.
1111"""
1212
13- import string
14-
15- letters : str = string .ascii_lowercase
16-
1713
1814def is_pangram (sentence : str ) -> bool :
1915 """
2016 Verify that the random sentences uses all the letters in the English alphabet.
2117
2218 :param sentence: The sentence to check for pangram validity
2319 :type sentence: str
24- :return: True if the sentence contains all 26 letters of the English alphabet, False otherwise
20+ :return: True if the sentence contains all 26 letters of the English alphabet,
21+ False otherwise
2522 :rtype: bool
2623 """
2724 # Empty string
2825 if not sentence :
2926 return False
30-
3127 # Convert sentence to lowercase and extract unique alphabetic characters
3228 unique_letters : set = set (
3329 char for char in sentence .lower () if char .isalpha ()
You can’t perform that action at this time.
0 commit comments