h = ['hp','op']
for x in ['POP','PHP','PYTHON']:
for y in h:
if y in x:
continue #如果这个跳出循环 ,下一句就不会print
print x
我的理解时直接跳出最外层的for循环,可是为什么不是这样呢?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
continue
只跳出最近(或最内层)的循环, 也就是内部的for
.