🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.f(1, 2)
  2. B.f(1, b=2)
  3. C.f(a=1, 2)
  4. 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 →