猫史档案馆


【Python作品分享】当你去买东西【作品秀】

用户:任立娜任立娜查看:0 回复:0 评论:0 创建时间:2022-05-15T18:26:48


【作品展示】

center_image

 

【作品介绍】

 

【作品源代码】

print('今天,你闲来无事来到了B站大厦来买衣服')
print('买什么好呢,你转身看了看自己的钱包不由得叹了一口气说:贫穷限制了你的想象,算了用这点钱去买东西吧!')
print('注意你只有320个硬币哦~')
print('1.我知道了')
print('2.就这么点?算了不买了!!!')
start_1 = input('请输入数字选项:')
if (start_1 == '2'):
    print('你由于过于生气喵在了半路上。游戏结束')
else:
    goods = ['小黄帽', '牛仔裤', '夹克', '连衣裙', '秋裤', '秋衣', '风衣', '西装裤', '衬衫', '卫衣', '马甲', '发箍', '棒球帽', '蓬蓬裙']
    price = [39, 85, 125, 99, 45, 40, 199, 299, 129, 89, 59, 29, 99, 109]
    # print(len(goods))
    # print(len(price))
    for i in range(len(goods)):
        print(i, goods[i], price[i])
    a = int(input('第一个商品的编号'))
    b = int(input('第二个商品的编号'))
    c = int(input('第三个商品的编号'))
    money = int(input('给钱!!!(记得一键三连~)'))
    total = ((price[a] + price[b]) + price[c])
    if (total <= money):
        print(((('一共需要' + str(total)) + '个硬币') + '感谢支持~'))
        print(goods[a], goods[b], goods[c])
    else:
        print(((('投币失败,总共' + str(total)) + '硬币。你这小子敢白嫖?') + '鬼!'))

 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页