banks = {
"National Bank of Canada" : "327",
"Toronto-Dominion Bank" : "302",
"Royal Bank of Canada" : "173",
"Wells Fargo" : "273",
"Goldman Sachs" : "87",
"Morgan Stanley" : "72",
"Canadian Imperial Bank of Commerce" : "83",
"TD Bank" : "108",
"Bank of Montreal" : "67",
"Capital One" : "47",
"FNB Corporation" : "4",
"Laurentian Bank of Canada" : "3",
"Ally Financial" : "12",
"Montreal Trust Company" : "145",
"Canadian Western Bank" : ".97"
}
for value in banks.values():
count += 1
total_mkt_cap += float(value)
total =+ count
if float(value) > float(largest):
largest = value
The variable largest
is now the value 327
, but I would like largest
to be the key which is "National Bank of Canada"
, not the value, any help appreciated, thank you