I really need help on this
def get_winner (dict_winner):
new_dict = {}
for winner in dict_winner:
first_letter = winner[0]
value = dict_
My solution - in one step:
def get_winner(candidates):
winners = dict.fromkeys(map(lambda f: f[0] for f in candidates.keys()))
for cand, votes in candidates.iteritems():
winners[cand[0]]+=votes
return [winner for winner, vote in winners.iteritems() if vote ==max(winners.values())]
It is not fancy, but it is simple :-)