Search for question
Question

3. Write a Python function that accepts two arguments: a list of integer values (list_1) and a single integer value (x). The function should process the list by checking each of its values in turn to determine if it is a multiple of the integer value "x". Each integer value from list_1 that is a multiple of the integer "x" should be added to a new list (list_2). Once all the values of list_1 have been processed, the new list (list_2) containing all of the multiples of "x" that were found should be sent as a return value to the calling code in the main program. For example, if the list [12, 9, 20, 7, 8, 16] and the integer value 4 were sent as arguments to the function, the new list [12, 20, 8, 16] should be sent back as a return value to the calling code as those are the values of the original list that are multiples of 4. Make sure to test your function from the main program of your Python file and print the result to ensure it works correctly.

Fig: 1