[Solved] python program using dictionary


Try This:

def orangecap(match_details):
    players_data = {}
    for k, v in match_details.iteritems():
        for player_name, score in v.iteritems():
            prev_player = player_name
            if prev_player == player_name:
                score = players_data.get(player_name, 0) + score
            players_data[player_name] = score
    high_score_player = max(players_data, key=lambda i: players_data[i])
    print (str(high_score_player), players_data[high_score_player])

6

solved python program using dictionary