Question: Write a program that keeps asking the user for new values to be added to a list until the user enters 'exit ['exit should NOT


Write a program that keeps asking the user for new values to be added to a list until the user enters 'exit ['exit should NOT be added to the list]. These values entered by the user are added to a list we call 'initial_list. Then write a function that takes this initial_list as input and returns another list with 3 copies of every value in the initial_Jist Finally, inside main), print out all of the values in the new list. For example: Input: Enter value to be added to list: a Enter value to be added to list: b Enter value to be added to list: c Enter value to be added to list: exit Output: Note how'exit is NOT added to the list Also, your program needs to be able to handle any variation of exit such as Exit, EXIT etc. and treat them all as 'exit. ode code.pyNew Full Screen 4 def main): for val input str input ('Enter value to be added to list:) 7 new list new_list function(initial list) #pr 9 main() 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
