KHTangent@lemmy.world to Programmer HumorEnglish · 1 year agoSwapping integers in Pythonlemmy.worldimagemessage-square16fedilinkarrow-up1168arrow-down1-1cross-posted to: bumba@boomer.casinopython@programming.dev
arrow-up1169arrow-down1imageSwapping integers in Pythonlemmy.worldKHTangent@lemmy.world to Programmer HumorEnglish · 1 year agomessage-square16fedilinkcross-posted to: bumba@boomer.casinopython@programming.dev
minus-squareJason Novinger@programming.devlinkfedilinkEnglisharrow-up1·1 year agoI raise you @lambda _: _() def result() -> int: global a; global b; a, b = b, a hat tip to @sisyphean@programming.dev via Cursed Python
minus-square𝕊𝕚𝕤𝕪𝕡𝕙𝕖𝕒𝕟@programming.devlinkfedilinkEnglisharrow-up2·edit-21 year agoHaha thanks, but the original idea is from @goodside on Twitter, I just screenshotted his tweet and harvested the upvotes :D
minus-squareJason Novinger@programming.devlinkfedilinkEnglisharrow-up2·1 year agoD’oh, you’re right! My bad and thanks for the catch!
I raise you
@lambda _: _() def result() -> int: global a; global b; a, b = b, a
hat tip to @sisyphean@programming.dev via Cursed Python
Haha thanks, but the original idea is from
@goodside
on Twitter, I just screenshotted his tweet and harvested the upvotes :DD’oh, you’re right! My bad and thanks for the catch!