Skip to content

Commit 990e0cb

Browse files
committed
Added pangram implementation
1 parent 1cc1953 commit 990e0cb

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pygorithm/string/pangram.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Author: OMKAR PATHAK
2+
# Created On: 17th August 2017
3+
4+
def is_pangram(sentence):
5+
'''
6+
PANGRAM: A sentence containing every letter of the alphabet.
7+
'''
8+
alphabet = list(map(chr, range(97, 123)))
9+
formattedString = ''.join(c for c in sentence if c.isalpha()).lower()
10+
return set(alphabet) == set(formattedString)
11+
12+
def get_code():
13+
""" returns the code for the current class """
14+
import inspect
15+
return inspect.getsource(is_pangram)

0 commit comments

Comments
 (0)