I'm trying to writhe a function that receives two lists in its input and returns their standard internal multiplication. I tried to do this with the FOR loop help but without success. The function returns None if the list length is not the same and also returns "0" if the lists are empty. I would be very happy if you examine my code and tell me what the problem might be and why the action is not being done to me.
Code:
def inner_product(vec_1, vec_2):
counter = 0
for i in range(len(vec_1), len(vec_2)):
if len(vec_1) != len(vec_2):
return None
elif len(vec_1) or len(vec_2) == []:
return "0"
else:
counter = vec_1[i]*vec_2[i]
return counter
print(inner_product([1, 2, 3], [4, 5, 6]))