x = True
for ship in ships.shipLengths.key():
while condition1:
# Code
while condition2 and x:
# Code
while condition3 and x:
# Code
if goto_1st_while:
x = False
continue
# The code here will not run when goto_1st_while is True
if not x:
continue
# The code here will not run when goto_1st_while is True
我同意@Aluan和@Daniel的观点,用这种方式编写代码不是一个好的做法。在
不管怎样,如果你还想这么做,这里有一个方法:
相关问题 更多 >
编程相关推荐