Files
2024-05-22 17:27:37 +02:00

850 B

id, title, challengeType, dashedName
id title challengeType dashedName
6579cbab9825b8170974c69a Step 13 20 step-13

--description--

You can remove a key-value pair from a dictionary by using the del keyword:

my_dict = {
    'name': 'Michael',
    'occupation': 'Lumberjack'
}

del my_dict['occupation']

Just before your for loop, use the del keyword to delete the 'age' key and its value from copper.

--hints--

You should use the del keyword to delete copper['age'] before the for loop.

({ test: () => assert.match(code, /^del\s+copper\s*\[\s*("|')age\1\s*\].*^for\s*/ms) })

--seed--

--seed-contents--

--fcc-editable-region--
copper = {
    'species': 'guinea pig',
    'age': 2
}
copper['food'] = 'hay'
copper['species'] = 'Cavia porcellus'

for i, j in copper.items():
    print(i, j)
--fcc-editable-region--