Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

args in python

# normal parameters with *args

def mul(a,b,*args): # a,b are normal paremeters
    multiply = 1
    for i in args:
        multiply *= i
        
    return multiply

print(mul(3,5,6,7,8))   # 3 and 5 are being passed as a argument but 6,7,8 are args 
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #args #python
ADD COMMENT
Topic
Name
8+6 =