Exerpad
🔥0
0 XP
Lv.1 Beginner
Log In

Fix the Loop

This program loops over a dictionary of ages but prints the wrong values. Fix it so it prints each person's actual age!

Expected output:

text
Alice is 10 years old
Bob is 12 years old
Charlie is 11 years old

💡 Hints

?Hint 1
🔒Hint 2
🔒Hint 3
python
ages = {"Alice": 10, "Bob": 12, "Charlie": 11}
for name in ages.keys():
print(name, "is", name, "years old")