Answers for "Packing- when we do not know how many arguments to use"

0

Packing- when we do not know how many arguments to use

# A Python program to demonstrate use
# of packing
 
# This function uses packing to sum
# unknown number of arguments
def mySum(*args):
    return sum(args)
 
# Driver code
print(mySum(1, 2, 3, 4, 5))
print(mySum(10, 20))
Posted by: Guest on August-05-2021

Code answers related to "Packing- when we do not know how many arguments to use"

Browse Popular Code Answers by Language