Nov-27-2019, 01:39 PM
Hi malevy, this is how i understand what you want to do. Is that right?
dictionary = {1: 10, 2: 20, 3: 30, 4:40} current = 10 found = False for key, value in dictionary.items(): if value == current: dictionary[key] = value + 3 * key found = True if not found: dictionary[current] = current * 2