---메인------



result = get_property_unit(tickers)
print(result)



-----함수--------


def get_property_unit(tickers):
    infos = get_infos()[0]
    result = {ticker:0 for ticker in tickers}

    for info in infos:
        if info['name1'] == '김':
            continue

        ticker = "김" + info['name2']       
        tmp = float(info['property'])
        result[ticker] = tmp
    return result


get_infos는


{'name1': '김', 'name2': '철수', 'property': '999.999', 'hobby': '수영', 'height': '111', 'age': '16'}


이런 식으로 된 딕셔너리고


tickers는 사람 이름들 있는 딕셔너리인데




if info['name1'] == '김':

TypeError: string indices must be integers


위 같이 오류가 뜨네


검색해보니 딕셔너리는 타입이 정수형만 와야 된다는데 그럼 코드 전체를 바꿔야 되나?


프로그래밍 너무 어렵다 ㅠㅠ