Worksheetspython functions
Total questions: 36
Worksheet time: 21mins
What is the default return value of a function that does not return any value explicitly?
Int
Float
Double
None
What does the function header contain?
The function name
The function name and parameter list
The parameter list
The return value
Which keyword is used for functions?
func
def
define
function
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
It displays an output
What is the Python built-in function used to display numbers and text on the screen?
input
output
command
holds whole numbers
holds a decimal point in a number
What is the output from the following code?
print ("hello world")
The requirements for printing a string in Python are:
( ) , ! and " "
( ) and !
( ) and " "
" " and !
Line 6 is called
function definition
function call
function name
The code highlighted in blue is best defined as:
function name
function call
function definition
arguments
parameters
What is the output of the given code?
10 20 10
10
20
10 20
What is the output of the given code?
10 20 10 20
10 20 10
10 20 20
Error
Function header in Python contains _________________.
function name
list of parameters
return type
all the above
Only A & B
What term is used to describe data passed into a function?
Variable
Loop
Constant
Parameter
Leo wants to create a function that will roll a dice. Which is the correct function definition header?
def dice roll ():
def diceroll ()
def diceroll ():
def diceroll []:
