Multiplying numbers in an argument function using the *args property in pythono

I can’t seemed to figure out how to solve the last test case in the screen shot

Here is my solution:
def combinations(*items):
result = 1

for x in items:
    result *= x
return result

Each number in the input to the function, represents the number of items in a group. basically the input is giving how many items are there in a group. So if there are 0 items in a group, then you should not multiply the value.


Add a condition to check if x > 0 to decide to multiply the number of items in a group.