Python中文
首页
教程
问答
标签
搜索
登录
注册
退出特定的while循环
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我能跳出嵌套while循环吗?你知道吗</p> <p>我用黄色突出显示了代码中发生的事情。可以看出,如果条件为真,它就会中断,并执行第一行“exit”。 <br/><br/> 有没有办法退出最后一个退出代码(用蓝环标记)</p> <p><br/> <a href="https://i.stack.imgur.com/ECmOA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ECmOA.png" alt="enter image description here"/></a></p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>使用自定义异常来中断。你知道吗</p> <pre><code>class ExitLoop(Exception): pass try: while True: while other: raise ExitLoop() except ExitLoop: exit() </code></pre>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
Python中是否有类似Clojure的线程宏?
9 回答
Python中是否有类似JPanel的组件?
3 回答
Python中是否有类似MATLAB的vpasolve的等价解算器
3 回答
python中是否有类似NLTK的东西不需要安装?
7 回答
python中是否有类似osgi在java中试图解决的需求?
7 回答
python中是否有类似PAM的模块?
8 回答
Python中是否有类似Perl的Data::Dumper的工具用来检查数据结构?
6 回答
python中是否有类似robocy的函数,带有重试选项?
2 回答
Python中是否有类似Rstudio的帮助部分?
1 回答
python中是否有类似ruby的索引方法?
5 回答
python中是否有类似于“perlpe”选项的内容?
2 回答
Python中是否有类似于C++ STL映射的结构?
3 回答
python中是否有类似于C中预处理器行为的工具?
7 回答
Python中是否有类似于Harmony的let关键字的内容?
7 回答
python中是否有类似于matlab中fzero的函数?
3 回答
python中是否有类似于MATLAB中peaks(N)的函数/实现?
3 回答
Python中是否有类似于Matlab的deconvblind的函数?
7 回答
Python中是否有类似于Perl中“想要”的东西
3 回答
Python中是否有类似于Perl正则表达式中的"local"变量?
6 回答
python中是否有类似于php的$$变量的语法
1 回答