We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents adfa11f + bc4078c commit 38bb0adCopy full SHA for 38bb0ad
P/pangram/pangram.py
@@ -0,0 +1,30 @@
1
+'''
2
+The code is for checking whether a given input string is a "pangram", that is,
3
+it contains all the letters from A to Z at least once.
4
+Assume the regular English alphabet of 26 letters.
5
+Any extra letters, numbers, punctuation etc are ignored.
6
+
7
+Example:
8
+Enter a string: the quick brown fox jumps over the lazy dog
9
+The number is pangram!
10
11
12
+def pangram(s):
13
+ l = len(s)
14
+ letters = set()
15
+ for char in s:
16
+ if char.isalpha() == True:
17
+ letters.add(char.lower())
18
+ if len(letters) == 26:
19
+ return True
20
+ return False
21
22
+str = input("Enter a string:")
23
24
+result = pangram(str)
25
26
+if(result == True):
27
+ print("The number is pangram!")
28
+else:
29
+ print("Not a pangram!")
30
0 commit comments