Question:

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 11, 2026
  • function
  • define
  • def
  • func
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is C

Solution and Explanation


Step 1: Understanding the Concept:

In programming, a function is a reusable block of code that performs a specific task. Every language has a specific "reserved word" or keyword to tell the interpreter that a function is being created.

Step 2: Detailed Explanation:

In Python, the keyword used is def, which is short for "define."
• The syntax follows the structure: def function_name():
• Unlike some other languages like JavaScript (which uses function) or C++ (which uses the return type), Python keeps it concise with three letters.

Step 3: Final Answer:

The keyword used to define a function in Python is def.
Was this answer helpful?
0
0