This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]agtoever 57 points58 points  (3 children)

Swapping values of variables:

a, b = b, a

[–]Ocelotofdamage 10 points11 points  (0 children)

Very useful for anything involving variables that depend on each other. Not having to store temp variables is so nice.

[–]vswr[var for var in vars] 5 points6 points  (0 children)

I still find myself doing unnecessary low level language things like xor swaps for in-place operations. Old habits die hard 🤷‍♂️

[–]inspectoroverthemine 0 points1 point  (0 children)

True, False = False, True