Dec-08-2020, 11:37 PM
I have a dictionary, and one of the keys currently has 1 as value, so the value side is an int. I'm trying to make the value side a list so it can have [1, 2].
I currently have: {'key1': 1}
I'm trying to get: {'key1': [1, 2]}
I currently have: {'key1': 1}
I'm trying to get: {'key1': [1, 2]}
test = dict() test['key1'] = 1 # i tried without success: # this will do an addition test['key1'] += 2 # this will replace the current value test.update({'key1': 2})thank you!