Python Dictionary Comprehension

PHOTO EMBED

Wed Feb 28 2024 07:51:24 GMT+0000 (Coordinated Universal Time)

Saved by @viperthapa #python

new_stocks = {symbol: price * 1.02 for (symbol, price) in stocks.items()}

Code language: Python (python)
content_copyCOPY

https://www.pythontutorial.net/python-basics/python-dictionary-comprehension/