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 | |
|---|---|---|
| 1class dog: pass | AOutput: Mia | |
| 2class Dog pass | BError: Missing colon after class name | |
| 3class Dog: pass d = Dog() | CError: Class names should be CapWords | |
| 4class Car: pass a = Car() b = Car() | DOutput: <class '__main__.Dog'> | |
| 5class Dog: pass d = Dog() print(type(d)) | EOk: Two separate objects | |
| 6class Cat: pass c = Cat() c.name = 'Mia' print(c.name) | FValid: Class defined and instance created |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Class — A blueprint that defines the structure of objects.~~Objectclass Dog:
passclass Dog:
pass
my_dog = Dog()p = Person()
p.name = 'Alice'class Car:
passprint(type(my_dog))