Font size
WorksheetsPython Quiz on functions
Total questions: 9
Worksheet time: 5mins
What is a function?
piece of code.
a type of variable.
a block of code which runs when it is called.
a block of code which runs automatically when we test our code.
What will be the output of the following function?
14
1
4
1,2
Error
Which of the following is a function?
def function():
print('hi')
def function()
print('hi')
make function():
print('hi')
define function():
print('hi')
What will be the output of the function?
Hello World!
Bye!
Hello World!
Hello World!
Bye!
Bye!
Hello World! Bye!
Hello World!
Hello World! Bye!
Hello World! Bye!
(a) function():
Fill in the blank.
What will be the output?
a triangle
fd(120)
rt(120)
Nothing
Error
Rewrite this line of code correctly.
(a)
What is the output of following code snippet:
10
24
7
1
What is a recursive function?
A function that calls other function.
A function which calls itself.
Both A and B
None of the above
