Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1randint(1, 6) | AOutput: 5.0 | |
| 2import Random | BError: Module names are lowercase | |
| 3import math print(math.pi) | CError: Must import random first | |
| 4import random random.randint(1, 10) | DOutput: 3 | |
| 5import math print(math.sqrt(25)) | EOk: Random integer 1-10 | |
| 6import math print(math.floor(3.9)) | FValid: Access math.pi |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
import — Keyword that loads a module so you can use its functions.~~Moduleimport random
print(random.randint(1, 10))import random
print(random.randint(1, 6))import time
time.sleep(2)import random
print(random.choice(colors))import time
time.sleep(3)