14 lines
272 B
Python
14 lines
272 B
Python
|
# function of update dict d
|
||
|
d = {}
|
||
|
def update_dictionary(d,key,value):
|
||
|
if key not in d:
|
||
|
new_key = int(key) *2
|
||
|
if new_key not in d:
|
||
|
d[new_key] = [value]
|
||
|
else:
|
||
|
d[new_key] += [value]
|
||
|
else:
|
||
|
d[key] += [value]
|
||
|
|
||
|
|