Question:medium

Which keyword is used to define a function in Python?

Show Hint

Remember that Python is designed for readability and brevity. Most of its keywords are short (e.g., ‘def‘, ‘elif‘, ‘pass‘).
Updated On: May 30, 2026
  • function
  • define
  • def
  • func
Show Solution

The Correct Option is C

Solution and Explanation

Step 1: Understanding the Concept:
Python uses reserved keywords to signal the start of specific code structures. For functions, a short keyword is used.
Step 2: Detailed Explanation:
- In Python, a function is defined using the def keyword.
- Syntax: \( def \ function\_name(parameters): \)
- Other languages use different keywords: Javascript uses 'function', while C/C++ uses the return type as the starting point. Python's 'def' stands for 'define'.
Step 3: Final Answer:
The correct keyword is def.
Was this answer helpful?
0


Questions Asked in CUET (UG) exam