Question: Let's wrap up with a function: ask _ questions ( ) . from operator import itemgetter def ask _ questions ( ) - > List

Let's wrap up with a function: ask_questions().
from operator import itemgetter
def ask_questions()-> List[List[str]]:
pass
Let's see an example:
>>> print(ask_questions())
What is your name? Sir Robin
What is your quest? To seek the Holy Grail
What is your favorite color? red
What is your name? Matt
What is your quest? to travel the world
What is your favorite color? blue
What is your name? Alexander
What is your quest? to invent the universe
What is your favorite color? silver
[['Matt','to travel the world', 'blue'],['Sir Robin', 'To seek the Holy Grail', 'red'],['Alexander','to invent the universe', 'silver']]
This should:
Request the name, quest, and favorite color three times
Save intermediate results to a list
Sort the list in alphabetical order based on the color. Hint: skim the operator.itemgetter
Links to an external site. documentation.

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!