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 | |
|---|---|---|
| 1nums = (1, 2, 3) nums.append(4) | AError: Missing closing bracket ] | |
| 2items = [1, 2, 3 print(items) | BOutput: 3 | |
| 3colors = ['red', 'blue', 'green'] | CError: Tuples have no append() | |
| 4mixed = [1, 'hi', True, 3.5] | DValid: List of strings | |
| 5nums = [1, 2, 3] print(len(nums)) | EOutput: [] | |
| 6items = [] print(items) | FOk: Mixed types in a list |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
List — An ordered collection of items in square brackets.~~[]colors = ['red', 'blue', 'green']numbers = [10, 20, 30]
print(len(numbers))empty = []pets = ['cat', 'dog', 'fish']names = ['Alice', 'Bob']
print(names)