A function in Python is defined using the func
keyword.
Answer: False
Functions in Python can return multiple values.
Answer: True
The return
statement is optional in a Python function.
Answer: True
Parameters are the actual values passed to a function when it is called.
Answer: False (These are arguments; parameters are defined in the function header.)
A function without a return
statement automatically returns None
.
Answer: True
Default arguments in Python must always come before non-default arguments in a function definition.
Answer: False
Functions in Python can be called before they are defined in the code.
Answer: False
The def
keyword is used to define a function in Python.
Answer: True
A function can be called multiple times in a program.
Answer: True
Indentation is not required in Python function definitions.
Answer: False
A function can have both positional and keyword arguments.
Answer: True
The global
keyword is used to define a function that can be accessed globally.
Answer: False
A function can modify the value of a global variable without using the global
keyword.
Answer: False
The pass
statement can be used as a placeholder in a function body.
Answer: True
Functions in Python can be nested inside other functions.
Answer: True
The is_even
function is a built-in Python function.
Answer: False
A function can be assigned to a variable in Python.
Answer: True
The return
statement can be used to exit a function early.
Answer: True