Is there a standardized method to swap two variables in Python?

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 Comment