#!/bin/python3 import string from functools import reduce h = {key: int(value) for key, value in zip(string.ascii_lowercase, input().strip().split(' '))} word = input().strip() height = reduce(max, map(lambda x: h[x], word)) print(len(word)*height)참고자료: 딕셔너리로 한꺼번에 가져오기 위한 자료.
https://stackoverflow.com/questions/16060899/alphabet-range-python
댓글 없음:
댓글 쓰기