I want to know what the following code means and what each of a
, b
, and c
become:
def addit(a,b,*c):
return a+b+sum(c)
addit(3,5,15,21,5)
I want to know what the following code means and what each of a
, b
, and c
become:
def addit(a,b,*c):
return a+b+sum(c)
addit(3,5,15,21,5)
a
and b
are the first two arguments (3
and 5
, respectively, in your example). c
is a positional argument - it's a list of all the arguments from the third onward (in your example, it is (15, 21, 5)
).