I\'d like to write a python function which adds all its arguments, using + operator. Number of arguments are not specified:
+
def my_func(*args):
How about this:
def my_func(*args): my_sum = 0 for i in args: my_sum += i return my_sum
If you don't want to use the += operator, then
+=
my_sum = my_sum + i