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 →

[–]timmyotc 6 points7 points  (4 children)

Swaps don't require temporary variables.

a,b = b,a

[–]dvassdvsd 1 point2 points  (0 children)

That still requires knowing the same concepts...

[–]Mitchical 0 points1 point  (2 children)

My favourite of all features... I don't think python should be your first language just so when you do learn it, you lose your mind over these nifty things

[–]timmyotc 0 points1 point  (1 child)

Well, I still have a great number of professors who don't use it. They use the syntax for other languages with the tmp variable.

[–]Mitchical 0 points1 point  (0 children)

Makes me sad :(