xxxxxxxxxx
# The max() function accepts two optional keyword-only arguments
# `key`: A function of one argument that is used to extract a comparison key from each input element.
# `default`: A value that is returned if the provided iterable is empty.
# If the iterable is empty and default is not provided, a ValueError is raised
print(max(empty_list, default="List is empty"))
# Output: List is empty
xxxxxxxxxx
max_tuple = max(temp_tuple, key=lambda x:x[1])
print(max_tuple)
>> ('B', 3)