WorksheetsBack to Basics: Python Lesson 6 - 7 Review
Total questions: 10
Worksheet time: 6mins
Name
Class
Date
1.
You want to write a loop that will ask you for an input until you enters the correct one. What kind of loop is that?
a)
repeat loop
b)
while loop
2.
What does the line below do?
from random import *
a)
import code from the turtle library
b)
import code from the random library
3.
Why do we use libraries?
a)
To use code that we can't write ourselves
b)
To reuse code that other programmers wrote
c)
To make our code more complicated
4.
What do we have to do to make a function run?
a)
define it
b)
call it
c)
run it
5.
How many lines of code will be printed?
a)
1
b)
2
c)
3
6.
While loops use conditions to run.
a)
True
b)
False
7.
Math is a library in Python
a)
True
b)
False
8.
Is the code below valid?
"name" = name
a)
Yes
b)
No
9.
You can write your own libraries
a)
True
b)
False
10.
Python libraries are written in separate files
a)
True
b)
False
100 %
