1. Home
  2. Data Science
  3. Python
  4. What does a bare * in def f(a, *, b) mean in Python?

Added 25 Nov 2026

What does a bare * in def f(a, *, b) mean in Python?

  1. Parameters after it are optional
  2. It collects extra arguments
  3. Parameters after it must be passed as keywords Correct answer
  4. It multiplies a and b

Correct answer

C. Parameters after it must be passed as keywords

MCQSEXAM

Explanation

Parameters after * are keyword-only.

Reference

Asked in: Python Interview Functions

https://docs.python.org/3/tutorial/controlflow.html#defining-functions

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs