You are viewing a single comment's thread. Return to all comments →
import math import os import random import re import sys
#
def pangrams(s): l=len(s) l1=[] for i in range (0,l): if(s[i]!=' ' and s[i] not in l1): l1.append(s[i]) l1.sort() l2=['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] print(l1,"\n",l2) if (l1==l2): return "pangram" else: return "not pangram"
if name == 'main': fptr = open(os.environ['OUTPUT_PATH'], 'w')
s = input().upper() result = pangrams(s) this might help.... fptr.write(result + '\n') fptr.close()
Seems like cookies are disabled on this browser, please enable them to open this website
Pangrams
You are viewing a single comment's thread. Return to all comments →
!/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): l=len(s) l1=[] for i in range (0,l): if(s[i]!=' ' and s[i] not in l1): l1.append(s[i]) l1.sort() l2=['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] print(l1,"\n",l2) if (l1==l2): return "pangram" else: return "not pangram"
if name == 'main': fptr = open(os.environ['OUTPUT_PATH'], 'w')