l={1:{'名称':'倚天','价格':123},
2:{'名称':'屠龙','价格':234}}
def chan():
for i,j in l.items():
print('序号:{},名称:{},价格:{}'.format(i,j['名称'],j['价格']))
k=[{'账号':'周','密码':'123','名字':'丰光'}]
def zhan():
print("登陆成功,欢迎你",i["名字"])
print("-----主菜单-------")
print('-1、展示')
print("-2、退出")
c=int(input("你的操作1/2:"))
return c
#主程序开始
while 1:
y=0
deng=int(input('登陆1/注册2:'))
if deng==1:
a=input('输入账号:')
b=input("输入密码")
for i in k:
if a==i["账号"]and b==i['密码']:
zhan()
if zhan==1:
chan()
else:
y=1
print('程序即将退出,期待下次光临')
break
##
##
##
##
##
##
## else:
##
Python 商店管理
最新推荐文章于 2025-04-07 15:52:16 发布