Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is in python! Create a function update_list that accepts two arguments -- inputList and inputStr. The function returns a list such that the second

This is in python!

Create a function update_list that accepts two arguments -- inputList and inputStr. The function returns a list such that the second through the fourth element in the inputList are replaced by the inputStr.

For example:

inputList = ["Cat", "Tiger", "Jaguar", "Leopard", "Puma"]

inputStr= "Dog"

would result in a return of:

["Cat", "Dog", "Dog", "Dog", "Puma"] 

Next, create the main user interface that displays the following instructions:

This program requires a list with a minimum of 4 elements. 

and presents an input

Enter the next item of the list, or 'Q' to finish: 

If the user does not enter a minimum of 4 elements then display the following message and end the program.

Not enough elements in the list - quitting. 

otherwise ask the user to

Enter a string: 

and call your update_list function with the proper arguments. Print out the result of the function call.

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

How Do I Use A Database Research Tools You Can Use

Authors: Laura La Bella

1st Edition

1622753763, 978-1622753765

More Books

Students also viewed these Databases questions

Question

Prove that, for all positive integers n and k (n k), n+1

Answered: 1 week ago

Question

explain what is meant by the terms unitarism and pluralism

Answered: 1 week ago