KHTangent@lemmy.world to Programmer Humor@lemmy.mlEnglish · 1 year agoSwapping integers in Pythonlemmy.worldimagemessage-square8fedilinkarrow-up166arrow-down11cross-posted to: [email protected][email protected]
arrow-up165arrow-down1imageSwapping integers in Pythonlemmy.worldKHTangent@lemmy.world to Programmer Humor@lemmy.mlEnglish · 1 year agomessage-square8fedilinkcross-posted to: [email protected][email protected]
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 @[email protected] via Cursed Python
I raise you
@lambda _: _() def result() -> int: global a; global b; a, b = b, a
hat tip to @[email protected] via Cursed Python