Answer:
FIRST SOLUTION
def multLists(list1,list2):
for i in range(len(list1)):
list1.append(list1[i]*list2[i])
return list1
SECOND SOLUTION
def multLists(list1,list2):
newlist = [ ]
for i in range(len(list1)):
newlist.append(list1[i]*list2[i])
return newlist
Step-by-step explanation:
First we define the function and call it MultLists. Then using a for statement, we loop through the list the number of times that is equivalent to the length of the list1. In the first solution, we append the element-wise multiplication in the two list and append this to list1. The return of the first solution, is list1 which contains list1 in addition to the product of the elements from list1 and list2
In the second solution, we create a new list, and using the append function, we populate it with the values of the element-wise multiplication from the two lists. The return of the second solution, is a new containing only to the product of the elements from list1 and list2