This question is to try to understand what the asterisk(*) works. As known, * could be used with args to make the function accept positional keywords later. Also, it could work as an operator to unpack a container. So my question is:
how to know its functionality?
def product(*num):
prod = 1
for i in num:
prod*= i
return prod
def product2(num):
prod = 1
for i in num:
prod*= i
return prod
num = [2,3,5]
So when you use different function, you will get different result. I just wanted to know what happened here? Thanks.