fb pixel

Too many arguments

Keyword arguments are very useful in big projects. It’s especially recommended to use keyword arguments for functions that have many (3+) arguments.
Yet, sometimes one might have confusing situations when dealing with both positional and keyword arguments. A company has developed software and they’ve written the following code, but they can’t easily run it and ask for your help.
What will be the output of the following program?
def print_gift(name, price, size):
	print(f'{name} - $${price} of size {size}')

print_gift('Lego', 100, price=200, size='3x4')
To check your solution you need to sign in
Sign in to continue