def rotate(self, nums, k):
if k==0:
return nums
else:
if len(nums)==1:
return nums
else:
l2=[0]*len(nums)
x=k%(len(nums))
for i in range(len(nums)):
if (i+x)<len(l2):
l2[i+x]=nums[i]
else:
l2[i+xlen(l2)]=nums[i]
return l2
Guys please help me to find out where goes wrong using my solution? Thanks you very much!

Yeah, where does it go wrong? The OJ tells you (input, output, expected), so why don't you tell us? It would help!
Anyway, you're making the common mistake of not modifying the given list but creating a new list that the OJ doesn't care about. They really mean it when they specify the result as:
@return {void} Do not return anything, modify nums inplace instead.