Hi all
just joined
I have a very annoying problem
I have a dictionary containing key value pairs that are all integers.
I want to check if some values equal a number, and if so, the value of each of these items will be changed with relation to its key.
and if no value matches the current number a new item is created
relevant piece of code:
for key, value in mydict.items():
if value == current:
value = value + 3 * key
if current not in mydict:
mydict[current:current * 2]
thank you all
this does not work
I need the correct synthax...
just joined
I have a very annoying problem
I have a dictionary containing key value pairs that are all integers.
I want to check if some values equal a number, and if so, the value of each of these items will be changed with relation to its key.
and if no value matches the current number a new item is created
relevant piece of code:
for key, value in mydict.items():
if value == current:
value = value + 3 * key
if current not in mydict:
mydict[current:current * 2]
thank you all
this does not work
I need the correct synthax...