Week 5 Unit 3: Self-test

22. October 2024

Question 1

Which of the following statements about parameters and functions are correct?

Note: There are 3 correct answers to this question.


Input parameters to functions must be of the primitive data type.
Functions in Python can have zero, one, or several parameters.
The data type of the parameters must be declared in the definition statement of the function.
The number of return values does not depend on the number of input parameters.
The naming rules for parameters are the same as the naming rules for variables.

Question 2

What is the outcome of the following program?

week5 unit3 f2

week5 unit3 f2 1
week5 unit3 f2 2
week5 unit3 f2 3
week5 unit3 f2 4

< Previous unit | Next unit > | Course Overview