python元组列表排序
list1 = list()
for i in range(5):
name = input(f'输入水果名字:')
price = int(input(f'输入水果价格(整数):'))
list1.append((name,price))
list1.sort(key=lambda x:x[1])
print(list1)
fighting
list1 = list()
for i in range(5):
name = input(f'输入水果名字:')
price = int(input(f'输入水果价格(整数):'))
list1.append((name,price))
list1.sort(key=lambda x:x[1])
print(list1)