In Python, I’ve seen two variable values swapped using this syntax:

left, right = right, left

Is this considered the standard way to swap two variable values or is there some other means by which two variables are by convention most usually swapped?

8 Answers
8

Leave a Reply

Your email address will not be published. Required fields are marked *