Clean Up a Profile
Python
15 pts
Clean Up a Profile
A user profile contains two keys that should not be there:
profile = {"name": "Abel", "age": 15, "city": "Keren", "password": "abc123", "temp": "delete me"}
- Remove
"password"withpop()and store the returned value in a variable calledremoved. - Remove
"temp"withdel. - Print
removed, then printprofile.
Expected output:
abc123
{'name': 'Abel', 'age': 15, 'city': 'Keren'}
Checklist
- Remove
"password"withpop()and keep the removed value inremoved. - Remove
"temp"withdel, keeping the rest ofprofile. - Print
removed, thenprofile.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
