The single asterisk in argument is given to read multiple arguments at once . In the below code if we call multiply(3,4,5,6) then the code will read all the inputs and then multiply. Otherwise we can not read multiple arguments.
def multiply(*args):
total=1
for arg in args:
total*=arg
return total
>>> multiply(3,4,5)
.... 60
======================
If we want to read a dictionary as argument or arbitrary keyword arguments then ** is needed.e.g.
def accept(**kwargs):
for keyword, value in kwargs.items():
print("%s -> %r" % (keyword, value))
>>> accept(foo=2,faa=3,gaa="gaa")
('foo', 2)
('faa', 3)
('gaa', 'gaa')
>>>
======================