首页 > 编程语言 > 详细

python成长之旅7

时间:2018-11-22 01:56:08      阅读:241      评论:0      收藏:0      [点我收藏+]

一、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

原文:https://www.cnblogs.com/lhai000/p/9998810.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!