Python 官方文档:入门教程 => 点击学习
# -*- coding: utf-8 -*- import sys user = "wangru" counter = 0 while True: if counter < 3:
# -*- 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
--结束END--
本文标题: python脚本
本文链接: https://lsjlt.com/news/185237.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0