This might be an extremely noob python question however I'm curious.
Is it possible to make right-hand value binding (not sure about terminology) in python?
Here's some code:
>>> d = {'a':1 , 'b': 2 }
>>> d['a']
1
>>> temp = d['a']
>>> temp
1
>>> temp = 4
>>> temp
4
>>> d
{'a': 1, 'b': 2}
Can we use temp
as a shortcut of d['a']
? So when we do temp = 4
, the last line to print {'a': 4, 'b': 2}
?
Does any syntax to do it exist or the only way to update the d['a']
value is by d['a'] = 4
?