def f1(p): li = [] for i in range(len(p)): if i % 2 == 1: li.append(p[i]) return li ret = f1([1,2,3,4,5]) print(ret)
时间: 2024-10-08 15:29:08
def f1(p): li = [] for i in range(len(p)): if i % 2 == 1: li.append(p[i]) return li ret = f1([1,2,3,4,5]) print(ret)