Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python L2- Quiz 2

Total questions: 7

Worksheet time: 4mins

Name
Class
Date
1.

Is the folowing code the proper way to define a function?


decl hello_function() =

print("hello")

a)

Yes

b)

No

2.

Time.time() returns a very large decimal number representing the number of seconds since January 1st, 1970

a)

True

b)

False

3.

Which of these is true about scope?

a)

local is inside global which is inside built-in

b)

built-in is inside local which is inside global

c)

global is inside built-in which is inside local

d)

python doesn't have scope

4.

What is the output of this code block?

a)

10 is out of bounds!

b)

10 is good

c)

out of bounds!

d)

NameError: name 'outOfBounds' is not defined

5.

What do parameters do?

a)

pass values into a function

b)

return one value from the end of a function

c)

store the name of the function

d)

They are the guidelines you follow to make a function

6.

What are the benefits of a function? check all that are true.

a)

They allow you to reuse your code

b)

They are cleaner and easier to read

c)

they are easy to change and update

d)

They can be used before they are declared

7.

True or False:

A module is a collection of libraries

a)

True

b)

False