def calculate(n, **kwargs):
n += kwargs["add"]
n *= kwargs["multiply"]
return n
print(calculate(3, add=3, multiply=5)) # (3+3)*5 = 30
#in python, arguments can be used using keywords
#the format is:
def function(arg,kwarg='default'):
return [arg,kwarg]
def fn(*, a): # only keyword arguments
print(a)
# fn(1) # error
fn(a=1)