1. Home
  2. Data Science
  3. Python
  4. Which Python keyword is used to define a function?

Added 16 Sep 2025

Which Python keyword is used to define a function?

  1. function
  2. define
  3. def Correct answer
  4. func

Correct answer

C. def

17 views

MCQSEXAM

Explanation

The 'def' keyword is used to define functions in Python, followed by the function name and parameters.

Reference

Asked in: GATE CS, UGC NET

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