我试图得到答案m = [0, 2, 0, 4, 0]:
m = []
while True:
for x in range(1, 6):
if x == 2:
m.append(x)
continue
else:
m.append(0)
continue
if x == 4:
m.append(x)
continue
else:
m.append(0)
continue
break
print(m)
Run Code Online (Sandbox Code Playgroud)
答案来了m = [0, 2, 0, 0, 0]