increment a value in a dictionary
- dict incr variable key ?increment?
Adds the given increment
value (an integer that defaults to 1 if not specified) to the value that the given key
maps to in the dictionary
value contained in the given variable
, writing the resulting dictionary value back to that variable, and returning the value of the entire dictionary. Non-existent keys are treated as if they map to 0. It is an error to increment a value for an existing key if that value is not an integer.
See also edit