Generation

generate functionWed, 21 Dec 2022

Rewrite this function without lambda max_key = max(dct, key=lambda key: dct[key]['Value'])

def max_dct(dct, key): return max(dct, key=lambda key: dct[key]['Value']) dct = { 'value1': {'Value': 3}, 'value2': {'Value': 1}, 'value3': {'Value': 2}, } max_dct(dct, 'Value') # returns 'value1'

Questions about programming?Chat with your personal AI assistant