mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-06 21:00:24 -04:00
871 B
871 B
id, title, challengeType, dashedName
| id | title | challengeType | dashedName |
|---|---|---|---|
| 6579cbab9825b8170974c69a | Schritt 9 | 20 | step-9 |
--description--
You can remove a key-value pair from a dictionary by using the del keyword. The syntax is the following:
my_dict = {
'name': 'Michael',
'occupation': 'Lumberjack`
}
del my_dict['occupation']
Just before your print() call, 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 print() call.
({ test: () => assert.match(code, /^del\s+copper\[\s*("|')age\1\s*\].*^print\s*\(\s*copper\s*\)/ms) })
--seed--
--seed-contents--
--fcc-editable-region--
copper = {
'species': 'guinea pig',
'age': 2
}
copper['food'] = 'hay'
copper['species'] = 'Cavia porcellus'
print(copper)
--fcc-editable-region--