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 | |
|---|---|---|
| 1from Enum import enum | AOk: Access the numeric value of an enum member | |
| 2Color(RED) | BValid: Correct import for Enum class | |
| 3from enum import Enum | COutput: <class 'bool'> | |
| 4Color.RED.value | DOutput: [0, 1, 2] | |
| 5list(range(3)) | EError: Incorrect import — use from enum import Enum | |
| 6type(True) | FError: Access members with Color.RED |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Enum — A class for creating sets of named constants.~~Memberfrom enum import Enum
class Color(Enum):
RED = 1class Color(Enum):
RED = 1print(Color.RED.value)print(Color.RED.name)for c in Color:
print(c)