# -*- 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
时间: 2024-12-16 09:40:27