nerdexam
Python_Institute

PCEP-30-02 · Question #162

A function denition starts with the keyword:

The correct answer is B. def. In Python, def is the reserved keyword used to define a function - it signals to the interpreter that a function declaration follows, along with its name, parameters, and body. Option A (fun) is not a keyword in Python; it exists in some other languages like Kotlin but has no…

Question

A function denition starts with the keyword:

Options

  • Afun
  • Bdef
  • Cfunction

How the community answered

(23 responses)
  • A
    4% (1)
  • B
    83% (19)
  • C
    13% (3)

Explanation

In Python, def is the reserved keyword used to define a function - it signals to the interpreter that a function declaration follows, along with its name, parameters, and body.

Option A (fun) is not a keyword in Python; it exists in some other languages like Kotlin but has no meaning in Python. Option C (function) is the keyword used in JavaScript, not Python - a common mix-up for those learning multiple languages simultaneously.

Memory tip: Think of def as short for define - you're defining what the function does. It's also only 3 characters, keeping Python's famously concise syntax in mind.

Community Discussion

No community discussion yet for this question.

Full PCEP-30-02 Practice