Question: create a list variable of at least 1 0 string type items and map it to a function that determines the length of each string.

create a list variable of at least 10 string type items and map it to a function that determines the length of each string.
Details:
Create a function that accepts a string parameter and returns a list including the string parameter and the length of that string
Output ->["myword",6]
Create a list of strings that is at least ten strings long
List ->["word1", "word2",..., "word10"]
Use the map function to map the list of strings to the function and convert it to a list of lists
Output ->[["myword",6],["word2",5]...]
Output the length of each string
Output ->6,5,...
You can just use a for loop to output this information

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 Databases Questions!