Answer:
Following are the code to the given question:
def list_function(initial_list):#defining a method list_function that takes list in parameter
l = initial_list*3#defining l that multiple the list by 3
return l#return list
def main(): #defining main method
initial_list = []#defining an empty list
while True:#defining while loop
i = input("Enter value to be added to list: ")#defining i variable that input list value
i = i.rstrip()#use rstrip method
if i.lower() == "exit" and "EXIT" and "Exit":#defining if block that checks list value is in lower case
break#use break keyword
initial_list.append(i)#use list that adds input value
l = list_function(initial_list)#defining l variable that calls the list_function method
for i in l:#defining for loop that print list items
print(i)#print value
main()
Output:
Please find the attached file.
Step-by-step explanation:
In this code, a method "list_function" is declared that takes list "initial_list" in parameter and defines "l" variable that multiple the list by 3 and return its list value.
In the main method an empty list "initial_list" is declared that defines a while loop that input list value and use rstrip method and define and if block that checks list value is in lower case and pass into the method and use for loop to prints its values.