标签:continue python counter import please
# -*- coding: utf-8 -*- import sys user = "wangru" counter = 0 while True: if counter < 3: name = raw_input("please input your name: ").strip() if len(name) == 0 : print "the name is null, try again" continue elif name == user: pass else: print "the user %s is not right try again" % name counter += 1 continue break else: print "too many times" sys.exit() age = int(raw_input("plz input your age:")) sex = raw_input("please input your sex:") dep = raw_input("which department:") message = ‘‘‘Information of the company staff: Name: %s Age : %d Sex : %s Dep : %s ‘‘‘ % (name,age,sex,dep) print message
本文出自 “实践就是真道理” 博客,谢绝转载!
标签:continue python counter import please
原文地址:http://44994.blog.51cto.com/34994/1669537