[알고리즘/백준] 10820: 문자열 분석(python)

유현민·2022년 4월 6일
0

알고리즘

목록 보기
103/253

EOF때문에 조금 오래 걸렸다..

while True:
    try:
        a = input().rstrip('\n')
        if not a:
            break
        ans = [0] * 4
        for i in a:
            ans[0] += 1 if i.islower() else 0
            ans[1] += 1 if i.isupper() else 0
            ans[2] += 1 if i.isdigit() else 0
            ans[3] += 1 if i.isspace() else 0
        print(*ans)
    except EOFError:
        break
        
profile
smilegate megaport infra

0개의 댓글