Looping over a dictionary with for
Predict the output · Basic · §7.2 Going through containers
Predict the output without running the code.
Code
for key in {"a": 1, "b": 2}:
print(key)Solve this problem in your browser
Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.