notesort(method has the 'keyargument it is not user-defined name def sort_name(all_data)return all_data['metal'ring_data sort(key=sort_namesort the data for data in ring_dataprint(data{'date''''metal''copper''radius' 'price' 'quantity' {'date''''metal''gold''radius' 'price' 'quantity' {'date''''metal''gold''radius' 'price' 'quantity' {'date''''metal''iron''radius' 'price' 'quantity' {'date''''metal''iron''radius' 'price' 'quantity' {'date''''metal''silver''radius' 'price' 'quantity' lambda operator the problem with above method is that we need to define one line function for each key 'metal''priceand 'radiusetc (if we want to sort on every key)which is not desirable coding-style lambda operators are the one operators which can be used to replace the one line function let' see some example of lambda operator firstsq lambda ** sq( one line function for ** sum num lambda xy lambda operator with two variable sum num( notein 'sq lambda ** 'the 'xis the input argument to function and the value after ':' ** is the return value and 'sqis the name of the function the statement is equivalent to below codedef sq( )return ** nowwe will use the sort(method using lambda operator as shown belowring_data sort(key=lambda all_data all_data['metal']for data in ring_dataprint(data(continues on next page list comprehension