用户:Y_Chara_Dreamer查看:0 回复:1 评论:0 创建时间:2020-07-19T11:48:29
【作品展示】

【作品介绍】
我还有啥好说的
【作品源代码】
alg=['A','B','C','D','E','F','G']
while True:
print('end:结束 0:查看书单 1:借书 2:还书 3:查询借书记录')
lbw=input('如何操作?:')
if lbw=='end':
break
elif lbw=='0':
print('目前有的图书:')
for 喵 in alg:
if '#' not in 喵:
print(喵)
else:
continue
elif lbw=='1':
cxk=input('要借哪本书:')
if cxk in alg:
print('好的,马上为您办理借书')
ctrl=input('借书人姓名:')
jntm=cxk+'#'+ctrl
alg.append(jntm)
alg.remove(cxk)
else:
print('没有此书或此书被借走')
elif lbw=='2':
cxk=input('书名:')
ctrl=input('姓名核对:')
jntm=cxk+'#'+ctrl
if jntm in alg:
alg.append(cxk)
alg.remove(jntm)
print('还书成功')
else:
print('请重新核对姓名和书名')
elif lbw=='3':
ctrl=input('查询借书人:')
nb=[]
for WQNMLGB in alg:
if ctrl in WQNMLGB:
nb.append(WQNMLGB[:len(WQNMLGB)-len(ctrl)-1])
else:
continue
print(ctrl+'借走的书有:')
for cao in nb:
print(cao)
else:
print('你™让我吃电脑屏幕?')
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn