首页 > 代码库 > 7月19
7月19
# msg = "hello egon 666"
# for i in msg:
# print(i)
#练习2
# count = 0
# while True:
# if count > len(msg):
# break
# print(msg[count])
# count += 1
#练习3
# msg = "hello alex"
# print(msg.replace("alex","sb"))
#练习4
# msg = "/etc/a.txt|365|get"
#
# print(msg.split("/")[1])
# print(msg.split("/")[2].split("|")[0])
# print(msg.split("/")[2].split("|")[1])
# print(msg.split("/")[2].split("|")[2])
#练习5
# while True:
# msg = input("==>:")
# print(msg)
#练习6
# while True:
# name = input("name:").strip()
# password = input("password:").strip()
# if len(name) ==0 or len(password) == 0:
# continue
# if password.isdigit():
# password = int(password)
# if name == "chen" and password == 123:
# print("正确")
# break
#练习7
# while True:
# msg = input("请输入内容")
# if msg.startswith("alex"):
# print(msg+"_SB")
#练习8
tag = True
while tag:
name = input("请输入姓名:").strip()
password = input("请输入密码:").strip()
salary = input("请输入工资:").strip()
work_mon = input("请输入工作年份:").strip()
if len(work_mon) ==0 or (not work_mon.isdigit()) or len(name) == 0 or len(password) ==0 or len(salary) ==0 or (not salary.isdigit()):
continue
else:
#输入成功
# salary = int(salary)
while tag:
search = input(‘‘‘
1 查询总工资
2 查询用户身份
3 退出登录
‘‘‘)
if search.isdigit():
search = int(search)
if search == 1:
print(salary)
elif search == 2:
if name == "alex":
print("super user")
elif name == "yuahao" or name == "wupeiqi":
print("normal user")
else:
print("unkown user")
continue
elif search == 3:
tag = False
7月19
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。