先建立壹個字典,比如:phoneNumbers =?
{'Bob': '444-4321', 'John': '555-1234', 'Mary': '555-6789', 'Jenny': '867-5309'}
按照值的大小順序排列
for value in sorted(phoneNumbers.values()):
for key in phoneNumbers.keys():
if phoneNumbers[key] == value:
print key, phoneNumbers[key]