What is the output of the following Python code snippet?
def f(a, b): return a + b
print(f(a=1, 2))
print(f(a=1, 2))
Correct answer
B. SyntaxError
5 views
B. SyntaxError
5 views
Positional arguments cannot follow keyword arguments; Python reports a SyntaxError before running.
Asked in: Python Interview Functions
https://docs.python.org/3/tutorial/controlflow.html#defining-functionsNot sure why the answer is B? Ask here and get an explanation.