-
将list进行操作以后的返回值,重新赋值给list
def move(a,m):
for i in range(m):
t = a.pop(0)
a = a.append(t)
return a
move([1,2,3,4,5,6,7],3)
'NoneType' object has no attribute 'pop'
def move(a,m):
for i in range(m):
t = a.pop(0)
a = a.append(t)
return a
move([1,2,3,4,5,6,7],3)
'NoneType' object has no attribute 'pop'