a = a ^ b
b = a ^ b
a = a ^ b
this post was submitted on 12 Jun 2023
67 points (98.6% liked)
Programmer Humor
40805 readers
331 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 6 years ago
MODERATORS
I raise you
@lambda _: _()
def result() -> int:
global a; global b; a, b = b, a
hat tip to @sisyphean@programming.dev via Cursed Python
Using an organic processor
Storing the value in the user instead of RAM!
This actually raises a very good question - could you increase the amount of available RAM by using the user?
Juggling chainsaws comes to mind.
Never used Python but that's hilarious.
Version 3 is disgusting.
That's like the canonical "swap two pointers" trick
So you are asking the user to do it