虽然python有for-else语句[1][2],但是用起来还是这样的逻辑更明显,可能是我太笨或者是我需要的应用场景不适合,总是用不好for-else,就先这样用着。
![26cf01afb1c1c52f7244d15fc80fe5c3.png](https://img-blog.csdnimg.cn/img_convert/26cf01afb1c1c52f7244d15fc80fe5c3.png)
for
这个用法主要是参考下面的网页,决定挺好,引用了一下。
参考网页:
Python break 多重循环的一种方法www.jianshu.com![3f0d521e631d68e403132976d4e0068b.png](https://img-blog.csdnimg.cn/img_convert/3f0d521e631d68e403132976d4e0068b.png)
参考
- ^https://book.pythontips.com/en/latest/for_-_else.html
- ^https://docs.python.org/3/tutorial/controlflow.html