分析:n>m 最后m个数为 str[m-1,len(n)-1] 最前的为str[:m-1]
n = [1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20]
m = int(input("请输入后移位置:"))
def f(m):
l1 = n[m-1:len(n)-1]
l2 = n[:m-1]
return l1+l2
print(f(m))
分析:n>m 最后m个数为 str[m-1,len(n)-1] 最前的为str[:m-1]
n = [1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20]
m = int(input("请输入后移位置:"))
def f(m):
l1 = n[m-1:len(n)-1]
l2 = n[:m-1]
return l1+l2
print(f(m))