3 ms·
Do you mean using the walrus operator? Because unless I missed a recent PEP, I don't know of a way to do this without something hacky like that.
by vgel 4y ago
Do you mean using the walrus operator? Because unless I missed a recent PEP, I don't know of a way to do this without something hacky like that.
- Iwan-Zotow 4y agoyes x = 1 y = 2 q = list(map(lambda t: ( tx := tx, ty := ty, tx+ty )[-1], [1, 2, 3])) print(q)