Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

Describe the types of power that effective leaders employ

Answered: 1 week ago

Question

Describe how leadership styles should be adapted to the situation

Answered: 1 week ago