Dia Egg - Shugo Chara

Python공부/프로그래머스

(Python)추억 점수 (프로그래머스 Lv.1)

별ㅇI 2023. 6. 12. 20:26
728x90
반응형

추억 점수 (Lv.1 프로그래머스)

def solution(name, yearning, photo):
    answer = []
    for i in range(len(photo)):
        result = 0
        for j in range(len(photo[i])):
            for k, nam in enumerate(name):
                if photo[i][j] == nam:
                    result+=yearning[k]
        answer.append(result)
                   
    return answer
728x90
반응형