Question: Create a function named get_strings that takes an argument called mylist and returns a new list that only contains strings. The strings should also be
Create a function named get_strings that takes an argument called mylist and returns a new list that only contains strings. The strings should also be sorted in ascending order
Function argument: This function takes one argument named mylist
What does it do?: This function takes the mylist argument that may have numbers and strings and removes the numbers from it and returns a new list with just strings
What it returns?: Returns a new sorted list with strings.
For instance,
mylist = ['zara', '124, 'jane', 5]
get_strings(mylist)
should return
['jane', 'zara']
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
