У меня есть словарь, и я хочу отобразить три самых больших элемента, но я хочу, чтобы он основывался на значении int ключа.Вот код:
cust_numb = int(input("Enter number of unique customers then press enter:"))
list_customer = {}
customers = 1
for y in range(0,cust_numb):
purch_numb = int(input("How many purchases did customer %s have %
(customers)))
list_customer.update({"customer{}".format(customers) : purch_numb})
customers = customers + 1
info = ""
for customer in range(0,cust_numb):
info += "%s " % ("customer {}".format(customer+1)) + "had %s " %
(list_customer["customer{}".format(customer+1)]) + "purchases. "
info = dict(dictionary)
Я не смог найти это онлайн, и любая помощь приветствуется!