🎙 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 8 of 10

What does / mean in def area(r, /, unit="cm"):?

What does / mean in def area(r, /, unit="cm"):?

  1. A.r is divided by unit
  2. B.r is optional
  3. C.r must be passed by position, not as r=...
  4. D.unit must be passed by position
Answer & explanation

Correct answer: r must be passed by position, not as r=...

Parameters before / are positional-only.

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 →