Question: Write a function, listMultiples, that takes a list, values, and a number as parameters and then multiplies each element of the list by the given
Write a function, listMultiples, that takes a list, values, and a number as parameters and then multiplies each element of the list by the given number and returns the updated list.
Use a while loop to go through the list and update the values. see for multiply function example As before, we use the condition while length of the list to scroll through the list. Also see Accessing List Elements as you will need to replace each existing value with the multiplied value. You will need to use the i in the of your list.
Ex: If the values list is:
and the number is the returned list would be:
You do not need a main function or to print anything. Only write the function with a returned list.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
