心有法竹
def findMaxSales(listoftuples): newlist = [] tuple = () for item in listoftuples: movie = item[0] value = (item[1]) tuple = value, movie newlist += [tuple] newlist.sort() highest = newlist[-1] result = highest[1] return result movieList = [("Finding Dory", 486), ("Captain America: Civil War", 408), ("Deadpool", 363), ("Zootopia", 341), ("Rogue One", 529), ("The Secret Life of Pets", 368), ("Batman v Superman", 330), ("Sing", 268), ("Suicide Squad", 325), ("The Jungle Book", 364)] print(findMaxSales(movieList))输出->侠盗一号