linusgroh’s Twitter Archive
—№ 2,899
⇤ Newest
Tweet
⇠ Newer
Tweet
Older
Tweet
⇢
Found a wonderful (ab)use case of the walrus operator in Python list comprehensions 🐍 >>> total = 0 >>> [total := total + i for i in range(10)] [0, 1, 3, 6, 10, 15, 21, 28, 36, 45] >>>
On twitter.com
♻️ 2
Retweets
❤️ 16
Favorites
2022 Aug 17
Mood +
5
🙂