Which keyword is used for defining a function in Python?
2026
Which keyword is used for defining a function in Python?
Answer: D. def — The keyword used for defining a function in Python is def. This keyword introduces the function definition block.
- A.
function
- B.
method
- C.
define
- D.
def
Attempted by 1068 students.
Show answer & explanation
Correct answer: D
The keyword used for defining a function in Python is def. This keyword introduces the function definition block.
Explore the full course: Bihar Stet Paper Ii Computer Science
Loading lesson…