Skip to content

Commit d4395fa

Browse files
committed
Update pangram.py
1 parent dd4730a commit d4395fa

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

pangram/pangram.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
11
"""
22
Pangram.
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

1814
def 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()

0 commit comments

Comments
 (0)