Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

function with args* example

def adder(*num):
    sum = 0
    
    for n in num:
        sum = sum + n

    print("Sum:",sum)

adder(3,5)
adder(4,5,6,7)
adder(1,2,3,5,6)
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #function
ADD COMMENT
Topic
Name
2+2 =