Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from string import ascii_lowercase, ascii_uppercase
- def pangram(s):
- L1 = list(s)
- L2, str2 = [], ""
- k = 0
- while k < len(L1):
- for i in L1:
- if i in ascii_lowercase:
- if i not in L2:
- L2.append(i)
- for j in L1:
- if (i == j) or (i == j.lower()):
- del L1[L1.index(j)]
- elif i in ascii_uppercase:
- if i.lower() not in L2:
- L2.append(i.lower())
- for j in L1:
- if (i == j) or (i == j.upper()):
- del L1[L1.index(j)]
- k += 1
- L2.sort()
- for i in L2:
- str2 += i
- if str2 == ascii_lowercase:
- return "pangram"
- else:
- return "not pangram"
- val = pangram("The Quick Brown Fox Jumps Over The Lazy Dog")
- print(val)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement