본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 9949번 Hide those Letters

by 현장 2024. 9. 5.

-Code

t = 1
while True:
    words = list(input().split())

    if words[0] == words[1] == '#':
        break
    print(f"Case {t}")
    for _ in range(int(input())):
        line = list(input())

        for i in range(len(line)):
            if line[i].lower() in words:
                line[i] = '_'

        print(*line, sep='')
    print()
    t += 1