3 ms·
You can also make it a bit prettier by adding spaces: >>> print(f"{d['key'][1] = }") d['key'][1] = 'one' It works with any expression you like, not just v
by mkl 6y ago
You can also make it a bit prettier by adding spaces:
>>> print(f"{d['key'][1] = }")
d['key'][1] = 'one'
It works with any expression you like, not just variables:
>>> print(f'{np.sin(np.pi/4.) = }')
np.sin(np.pi/4.) = 0.7071067811865475
- amelius 6y ago> It works with any expression you like Also assignment expressions? :)
- Aeolun 6y agoNot sure if I would consider that an improvement.