Solution Review: Increment Dictionary Values

This lesson will explain how to increment values in a dictionary.

Solution: Loop Over the Dictionary and Increment Value

Use a for loop to iterate over the length of the dictionary, incrementing the value of age in the dictionary with a number n and then saving the value in a new dictionary.

The following illustration explains the concept of iterating the values of a dictionary containing only 3 students.

Get hands-on with 1200+ tech skills courses.