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 | |
|---|---|---|
| 1person = {'name': 'Ali'} print(person['age']) | AError: Keys need quotes if string | |
| 2d = {name: 'Alice'} | BOutput: <class 'dict'> | |
| 3person = {'name': 'Ali', 'age': 20} | CValid: Dict with two key-value pairs | |
| 4d = {} d['x'] = 10 | DError: Key 'age' doesn't exist | |
| 5p = {'name':'Ali'} print(p['name']) | EOutput: Ali | |
| 6p = {} print(type(p)) | FOk: Add key to empty dict |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Dictionary — A collection of key-value pairs in curly braces {}.~~Keyperson = {'name': 'Alice'}print(person['name'])d = {}
d['color'] = 'blue'pet = {'type': 'cat'}scores = {'math': 90, 'english': 85}