Question: Python Question: Silence of the Lambda (and listsorting) Part 1: Lambda Sorting Write a function named second_sorter that takes in a list ofstrings: def second_sorter(strings):

Python Question: Silence of the Lambda (and listsorting)

Part 1: Lambda Sorting

Write a function named second_sorter that takes in a list ofstrings:

def second_sorter(strings):

# sort the strings based on the 2nd letter

return strings

and does does the following:

  • returns the strings sorted by the second character.

  • you must use the sorted function (not the sort method)

  • you must use a lambda function for the sorter

  • you can assume each item in strings will be at least 2characters long

The following should work after you are done:

print(second_sorter(["dog", "cat", "snake"]))

Part 1: Lambda Sorting Write a function named second_sorter that takes in

Part 1: Lambda Sorting Write a function named second_sorter that takes in a list of strings: def second sorter (strings): # sort the strings based on the 2nd letter return strings and does does the following: returns the strings sorted by the second character. you must use the sorted function (not the sort method) you must use a lambda function for the sorter you can assume each item in strings will be at least 2 characters long The following should work after you are done: print(second_sorter(["dog", "cat", "snake"]))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!