输入:8 输出:7
用list实现循环遍历的过程
import copy
a=[1,2,3,4,5,6,7,8]
b =[]
count =0
while len(a) >= 2:
for i in range(len(a)):
if a[i] not in b:
b.append(a[i])
count +=1
if count %3 ==0:
print(i,count)
b.remove(a[i])
a = copy.deepcopy(b)
b =[]
print(a[0])