Question:

Which keyword is used to define a function in Python?

Show Hint

Every user-defined function in Python begins with the keyword def.
Updated On: Jun 8, 2026
  • function
  • define
  • def
  • fun
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation

Concept: A function is a reusable block of code that performs a specific task. In Python, functions are created using the def keyword.

Step 1:
Recall the syntax for function definition General syntax: \[ \texttt{def function\_name():} \] Example: def add(a, b): return a + b

Step 2:
Identify the correct keyword Python uses the keyword def to define a function. Final Answer: \[ \boxed{\texttt{def}} \]
Was this answer helpful?
0
0