KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

In Python, the keyword used for defining a function is …………..

  1. func
  2. function
  3. def
  4. import

Python Functions

1 Like

Answer

def

Reason — In Python, the keyword def is used to define a function. It is followed by the function name and parentheses containing the parameters, ending with a colon. The other options like func and function are not valid Python keywords, while import is used to include modules.

Answered By

2 Likes


Related Questions