[파이썬]

청수동햄주먹·2023년 4월 10일
0

파이썬코딩테스트

목록 보기
22/35
def solution(name, yearning, photo):
    score = {name[i]:yearning[i] for i in range(len(name))} 
    # score = dict(zip(name,yearning))
    answer = []
    for people in photo:
        add = 0
        for person in people:
          if person in score:
            add += score[person]
        answer.append(add)
    return answer
profile
코딩과 사별까지

0개의 댓글