nums[start], nums[i] = nums[i], nums[start]That's convenient way to swap values in python
in slow motion this will be evaluated as follows
1. on the right hand-side create tuple with two values - nums[i] and nums[start]
2. unpack that tuple into nums[start] and nums[i]. that is called iterable unpacking. i.e. you can do something like a, b = [1, 2] in which case a=1 and b=2
Of cource nums should be mutable object (e.g. list, dict, etc.), i.e. it will not work if nums is a tuple
it's equivalent to
foo = num[i] num[i] = num[start] num[start] = foobut without the need of third variable to hold one of the values temporarily
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs