#后宫选妃+个人IP系统+学籍管理系统)代码
#学籍管理系统
print("====后宫选妃+个人IP系统+学籍管理三合一系统====")
print("1.后宫选妃系统 =")
print("2.个人IP系统 =")
print("3.学籍管理系统 =")
print("=========================================")
userinput=input("请输入相应的数字:")
if userinput=="1":
# 后宫选妃
print("=================欢迎来到后宫选妃系统==========================")
king_message = {}
while True:
king_name = input("皇上,请输入您的名字,或者输入Q退出系统:")
if king_name == "Q":
break
else:
beauty_name = input("请输入您要选择的妃子:")
if king_name not in king_message.keys():
king_message[king_name] = []
king_message[king_name].append(beauty_name)
else:
if beauty_name not in king_message[king_name] and len(king_message[king_name]) < 3:
king_message[king_name].append(beauty_name)
elif beauty_name in king_message[king_name]:
print("该妹子已经在您的后宫!")
else:
print("您的身体吃紧,需要服用伸腿瞪眼丸!")
print(king_message)
elif userinput=="2":
# 个人IP系统
print("=================欢迎来到个人IP系统==========================")
IPmessge = {}
while True:
num1 = input("请输入您的身份证号,或者输入Q退出系统:")
if num1 == "Q":
break
if num1 in IPmessge.keys():
print("您已注册过!")
else:
ip_address = input("请输入您的ip地址:")
count1 = list(IPmessge.values()).count(ip_address)
if count1 < 3:
IPmessge[num1] = ip_address
else:
print("您的IP太受欢迎!已注册过多!")
print(IPmessge)
elif userinput=="3":
print("=================欢迎来到学籍管理系统=========================")
dic1 = {}
while True:
student_num = input("请输入学号,或者输入Q退出系统:")
if student_num == 'Q':
break
if student_num in dic1.keys():
print("您已经注册了!")
else:
dic1[student_num] = {}
dic1[student_num]["name"] = input("请输入姓名:")
dic1[student_num]["gender"] = input("请输入性别:")
dic1[student_num]["age"] = input("请输入年龄:")
hobby = []
while True:
stu_hobby = input("请输入您的爱好,输入E结束爱好的输入:")
if stu_hobby == 'E':
break
else:
hobby.append(stu_hobby)
dic1[student_num]["hobby"] = hobby
print(dic1)
else:
print("输入错误")
运行结果:
标签:king,name,python,ip,else,print,input,选妃,message From: https://blog.51cto.com/u_15937426/7334827