In Python, I\'ve seen two variable values swapped using this syntax:
left, right = right, left
Is this considered the standard way to swap
I would not say it is a standard way to swap because it will cause some unexpected errors.
nums[i], nums[nums[i] - 1] = nums[nums[i] - 1], nums[i]
nums[i] will be modified first and then affect the second variable nums[nums[i] - 1].
nums[i]
nums[nums[i] - 1]