PCEP 30 02 PCEP Certified Entry Level Python Programmer · Free Practice Question Medium
Question 10
What is printed by the given code snippet ?
- def num(x = 1, y = 3):
- x = x + y
- y += 1
- print(x, y)
- num(y = 3, x = 1)
-
A
error
-
B
4 4
-
C
3 2
-
D
4 2
Reveal correct answer
Correct answer: B
Explanation
Since we have specified the variables in the functional argument with specific values, the position and default values don't matter.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
You must be logged in to post a comment.
