This syntax is a fragment assignment. Slice [:]means the whole list. The difference between nums[:] =and nums =is that the latter does not replace the items in the original list. This is observed when there are two links to the list.
>>> original = [1, 2, 3]
>>> other = original
>>> original[:] = [0, 0]
>>> other
[0, 0]
To see the difference, simply remove [:]from the task above.
>>> original = [1, 2, 3]
>>> other = original
>>> original = [0, 0]
>>> other
[1, 2, 3]
, list - , ,
>>> list = [1,2,3,4]
>>> list[:] = [...]
>>> list
[Ellipsis]