If i have a dictionary that has two values per entry in a tuple eg . (jon, 100) (ellie, 200) (mati, 120) (steve, 250) I want to order them in order of their score (second value). But then i only want to display the names. eg : steve, ellie, mati , jon how would i go about it?
f = open('data.csv','r')
reader = csv.reader(f)
new_dict = {}
for row in reader:
new_dict[row[0]] = random.gauss(float(row[1]), float(row[2]))
order_list = sorted(new_dict, key = new_dict[row[0]], reverse = False)
return order_list
so far i got this and i also get errors like
"order_list = sorted(new_dict, key = new_dict[row[0]], reverse = False)"
TypeError: 'float' object is not callable
any help would be grand.