-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpangrams.py
40 lines (30 loc) · 918 Bytes
/
pangrams.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#https://www.hackerrank.com/challenges/one-month-preparation-kit-pangrams/problem?isFullScreen=true&h_l=interview&playlist_slugs%5B%5D=preparation-kits&playlist_slugs%5B%5D=one-month-preparation-kit&playlist_slugs%5B%5D=one-month-week-one&h_r=next-challenge&h_v=zen
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'pangrams' function below.
#
# The function is expected to return a STRING.
# The function accepts STRING s as parameter.
#
def pangrams(s):
# Write your code here
m = dict()
count = 0
for i in s:
if i != " " and i.lower() not in m:
m[i.lower()] = True
count += 1
if count >= 26:
return 'pangram'
return 'not pangram'
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
s = input()
result = pangrams(s)
fptr.write(result + '\n')
fptr.close()