18
QuizMultiple Choice

Resources for Programmers — Unit test

Question 18 • Introduction to Information Technology - EL3701

Which is an example of a function header in Python?

Answer
A
left (40):
B
def drawT():
C
left
D
def

Explanation

A Python function header starts with def, followed by the function’s name and parentheses, and ends with a colon. “def drawT():” has all of these parts, so it is a valid function header; “def” alone is incomplete.

AI-written and checked against the verified answer.

Previous
Next