← Quiz: Scope and Closures: all 10 questions
Quiz: Scope and Closures · Question 7 of 10
Given def f(a, , b):, which call is valid?
Given def f(a, *, b):, which call is valid?
- A.f(1, 2)
- B.f(1, b=2)
- C.f(a=1, 2)
- D.f()
Answer & explanation
Correct answer: f(1, b=2)
b comes after a bare *, so it must be passed by keyword.
Can you get the rest right without peeking?
Take the timed Quiz: Scope and Closures quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →