File tree Expand file tree Collapse file tree 1 file changed +27
-2
lines changed
Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Original file line number Diff line number Diff line change 1- def is_pangram (sentence ):
2- pass
1+ """
2+ Pangram.
3+
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.
8+
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.
11+ """
12+ import string
13+
14+ letters : str = string .ascii_lowercase
15+
16+
17+ def is_pangram (sentence : str ) -> bool :
18+ """
19+ Verify that the random sentences uses all the letters in the English alphabet.
20+
21+ :param sentence: The sentence to check for pangram validity
22+ :type sentence: str
23+ :return: True if the sentence contains all 26 letters of the English alphabet, False otherwise
24+ :rtype: bool
25+ """
26+ sentence = sentence .lower ()
27+ return all (char in letters for char in sentence if char .isalpha ())
You can’t perform that action at this time.
0 commit comments