@KHTangent to Programmer [email protected]English • 1 year agoSwapping integers in Pythonimagemessage-square15arrow-up1108arrow-down11cross-posted to: [email protected][email protected]
arrow-up1107arrow-down1imageSwapping integers in Python@KHTangent to Programmer [email protected]English • 1 year agomessage-square15cross-posted to: [email protected][email protected]
minus-squareJason NovingerlinkfedilinkEnglish3•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
minus-square𝕊𝕚𝕤𝕪𝕡𝕙𝕖𝕒𝕟linkfedilinkEnglish2•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 NovingerlinkfedilinkEnglish2•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 @[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!