KnowledgeBoat Logo
|

Robotics & Artificial Intelligence

Which of the following are the two main parts of every function in Python?

  1. Function header and function body
  2. Function block and main block
  3. Function head and function tail
  4. None of the above

Python Functions

1 Like

Answer

Function header and function body

Reason — Every function in Python consists of two main parts — the function header which contains the def keyword, the function name, and the list of parameters, and the function body which contains the set of statements to be executed. Together, they form the function block.

Answered By

2 Likes


Related Questions