猫史档案馆


【Python作品分享】图书管喵-成果包【教程贴】

用户:老嫂子很无语老嫂子很无语查看:0 回复:0 评论:0 创建时间:2023-04-28T20:01:28


【作品展示】

center_image

 

【作品介绍】

 

【作品源代码】

bookk = ['哈利波特', '流浪地球', '西游记']
while True:
    print('end 结束 0展示书单 1借书 2还书')
    hei = input('你好要干嘛')
    if hei == 'end':
        break
    elif hei == '0':
        for x in bookk:
            if '#' not in x:
                print(x)
            else:
                continue
    elif hei == '1':
        book = input("借哪本书")
        if book in bookk:
            print("好的")
            user = input('姓名')
            bo = book + 'a' + user
            bookk.append(bo)
            bookk.remove(book)
            print('成功')
        else:
            print('没有')
    elif hei == '2':
        book = input('要换哪本书')
        book = input('核对借书人')
        bo = book + "#" + user
        if bo in book:
            book.append(book)
            book.remove(bo)
            print('还书成功')
        else:
            print("???别搞我")

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页