KHTangent@lemmy.world to Programmer Humor@lemmy.mlEnglish · 2 years agoSwapping integers in Pythonlemmy.worldimagemessage-square7fedilinkarrow-up161arrow-down10cross-posted to: [email protected]python
arrow-up161arrow-down1imageSwapping integers in Pythonlemmy.worldKHTangent@lemmy.world to Programmer Humor@lemmy.mlEnglish · 2 years agomessage-square7fedilinkcross-posted to: [email protected]python
minus-squareJason NovingerlinkfedilinkEnglisharrow-up2·2 years agoI raise you @lambda _: _() def result() -> int: global a; global b; a, b = b, a hat tip to @[email protected] via Cursed Python
minus-square𝕊𝕚𝕤𝕪𝕡𝕙𝕖𝕒𝕟linkfedilinkEnglisharrow-up2·edit-22 years agoHaha thanks, but the original idea is from @goodside on Twitter, I just screenshotted his tweet and harvested the upvotes :D
minus-squareJason NovingerlinkfedilinkEnglisharrow-up2·2 years 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 @[email protected] 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!