지나가던 개발자

[Python] 백준 10384번(팬그램) 문제 풀이 본문

PS/Python

[Python] 백준 10384번(팬그램) 문제 풀이

KwonYongHyeon 2022. 11. 14. 18:32

 

from string import ascii_uppercase

for i in range(int(input())):
    tc = [x for x in list(input().upper().replace(" ", "")) if x in list(ascii_uppercase)]
    if set(tc) == set(ascii_uppercase):
        triple_pangram = True
        double_pangram = True
        pangram = True
        for j in set(tc):
            if tc.count(j) >= 3:
                continue
            elif tc.count(j) == 2:
                triple_pangram = False
            elif tc.count(j) == 1:
                double_pangram = False
        if triple_pangram:
            print("Case "+str(i+1)+": Triple pangram!!!")
        elif double_pangram:
            print("Case "+str(i+1)+": Double pangram!!")
        else:
            print("Case "+str(i+1)+": Pangram!")
    else:
        print("Case "+str(i+1)+": Not a pangram")
Comments