码迷,mamicode.com
首页 > 编程语言 > 详细

python成长之旅7

时间:2018-11-22 02:47:46      阅读:146      评论:0      收藏:0      [点我收藏+]

标签:input   rip   col   lse   一个   nbsp   class   全局   inpu   

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

标签:input   rip   col   lse   一个   nbsp   class   全局   inpu   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!