python成长之旅7
Posted lhai000
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python成长之旅7相关的知识,希望对你有一定的参考价值。
一、tag编程方法
定义一个全局变量,如果全局变量等于False。则退出整个程序。
* tag编程方法 etc: tag = True while tag: print(‘levl1‘) choice = input(‘levl1>>>>:‘).strip if choice == ‘quit‘: break while tag: print(‘levl2‘) choice = input(‘levl2>>>>:‘).strip if choice == ‘quit‘: break while tag: print(‘levl3‘) choice = input(‘levl3>>>:‘).strip if choice == ‘quit‘ break if choice == ‘quit_all‘: tag = False
以上是关于python成长之旅7的主要内容,如果未能解决你的问题,请参考以下文章