NEW
Font size
WorksheetsPython Function Review
Total questions: 10
Worksheet time: 6mins
Choose the INVALID Function name
def _output():
def output_():
def OUT_PUT9():
def 9OUTPUT():
In declaring a function, a number of parameters is always required.
True
False
Select the correct description of the output
The output is "4" because the parameter "a" is increased by 1
The script is error
No output
"None" will be printed in the console
The parameter is optional in defining a function. But if there are parameters, it should be up to ten (10) only.
True because it will crash the memory if the parameters are more than 10.
True because it is part of the syntax in declaring a Python function.
False because the declaration of the number of parameters has no limit.
False because the limit is up to twenty (20).
Describe the output of the Python script
The script is error because you cannot perform arithmetic operations in a return statement
The script is error because the function must be defined first before calling it
"None" will be displayed in the console since the function is declared after calling it
"3" is the output because 2 is passed to the output() function and return (2+1)
Is the code error?
Yes, because you cannot return a function in line 2
Yes, because you should call these functions after defined.
No, the code works well.
What is the correct syntax for creating a function in Python?
def a():{}
def a(x,y,z):
def a(x){}
def a(){}
How do you call the "output" function?
output(2,1):
output{1,2}
output<1,2>
output(2,1)
What is the output of the script?
None
No output. The code is error!
X
Y
How do you call the update() function to print "Middle" in the console?
print(update(6))
update(7)
print(update(5))
update(5)
