class Solution(object):

def rotate(self, nums, k):

if nums != [] and k >0:

x=(nums[len(nums)-k:len(nums)])

x.reverse()

print(x)

for i in x:

nums[0:0]=[i]

nums[len(nums)-k:len(nums)]=[]

return nums

elif k == 0:

return nums

Error when

Input: [1]

0

Output: Do not return anything, modify nums in-place instead.

Expected: [1]