Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

args in python

def mul(*args):  # args as argument
    multiply = 1
    for i in args:
        multiply *= i
        
    return multiply

lst = [4,4,4,4]
tpl = (4,4,4,4)    

print(mul(*lst))  # list unpacking
print(mul(*tpl)) # tuple unpacking
 
PREVIOUS NEXT
Tagged: #args #python
ADD COMMENT
Topic
Name
1+2 =