Question: 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

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!