用户:
无敌暴龙战士0728查看:0 回复:1 评论:0 创建时间:2023-03-25T17:03:05
【作品展示】

【作品介绍】
大家好这是我的作品
【作品源代码】
lib = ['哈利波特', '流浪地球', '封神演义', '三国演义', '红楼梦', '西游记', '水浒传']
while True:
print('end:结束管理图书', '0:展示书单', '1:借书', '2:还书')
message = input('你好!要图书助手帮你做什么:')
if (message == 'end'):
break
elif (message == '0'):
print('目前有图书:')
for x in lib:
if '#' not in x:
print(x)
else:
continue
elif (message == '1'):
book = input('要借哪本书')
if book in lib:
print('好的,马上帮您办理借书')
user = input('请登记借书人姓名:')
bo = book + '#' + user
lib.append(bo)
lib.remove(book)
else:
print('没有此书或此书已被拿走!')
elif message == '2':
book = input('要还哪本书')
user = input('核对借书人')
bo = book + '#' + user
if bo in lib:
lib.append(book)
lib.remove(bo)
print('还书成功!')
else:
print('请检查书名或借书人信息是否正确:')
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn