这是我的代码:
the_list = ['Lily', 'Brad', 'Fatima', 'Zining']
for name in the_list:
print(name)
if name == 'Brad':
the_list = ['Tom', 'Jim', 'Garry', 'Steve']
else:
continue
Run Code Online (Sandbox Code Playgroud)
如何使 for 循环现在通过新列表运行
我知道我可以在 if 语句中创建一个新的 for 循环,但这不是我想要的。