单选题

执行下面Python代码后,输出的结果是?(    )

tuples = [(1, 'apple'), (2, 'banana'), (0, 'cherry')]

sorted_tuples = sorted(tuples, key=lambda x: x[1])

print(sorted_tuples)

A

[(1, 'apple'), (0, 'cherry'), (2, 'banana')]

B

[(2, 'banana'), (1, 'apple'), (0, 'cherry')]

C

[(0, 'cherry'), (1, 'apple'), (2, 'banana')]

D

[(1, 'apple'), (2, 'banana'), (0, 'cherry')]

赣ICP备20007335号-2