4 methods in python : index assign, list slicing, reversed
\nclass Solution(object):\n    def rotate(self, nums, k):\n        """\n        :type nums: List[int]\n        :type k: int\n        :rtype: None Do not return 
```\nclass Solution(object):\n    def rotate(self, nums, k):\n        """\n        :type nums: List[int]\n        :type k: int\n        :rtype: None Do not return anything, modify nums in-place instead.\n        """\n        \n        # Method 1 : list slicing\n        k = k % len(nums)\n        if len(nums) > 1 and k > 0:\n            nums[:] = nums[-k:] + nums[:-k]\n        \n        # Method 2 : list replacing\n        k = k % len(nums)\n        if len(nums) > 1 and  k > 0:\n            nums[:k], nums[k:] = nums[-k:], nums[:-k]\n            \n        # Method 3 : index assigning\n        k = k % len(nums)\n        tmp = nums[-k:]\n        for index in range(len(nums)-1, k-1, -1):\n            nums[index] = nums[index-k]\n        for index, value in enumerate(tmp):\n            nums[index] = value\n\n        # Method 4 : reversed method\n        k = k % len(nums)\n        if len(nums) > 1 and  k > 0:\n            nums[:] = reversed(nums)\n            nums[:k], nums[k:] = reversed(nums[:k]), reversed(nums[k:])\n```
['Python3']