列表和循环练习 2

# encoding utf-8
# 烟酒店系统买货退货系统

print('*' * 60)
print('\t\t\t\t\t耀哥烟酒铺,欢迎你光临')
cigarettes = [[1, '蓝黄鹤楼', 19], [2, '红利群', 15], [3, '芙蓉王', 25], [4, '红南京', 12], [5, '黄金叶', 10],
              [6, '红黄鹤楼', 26], [7, '蓝利群', 19], [8, '大前门', 21], [9, '好日子', 10], [10, '南洋双喜', 13]]
for cigarette in cigarettes:
    print('\t\t\t{}、{}    \t\t\t¥:{}'.format(cigarette[0], cigarette[1], cigarette[2]))
print('*' * 60)
choice1 = input('老板要买烟吗yes/no:')
if choice1 == 'yes':
    choice = int(input('老板要买什么烟?'))
    count = int(input('老板要几包?'))
    money = int(input('给钱:'))
    moneys = count * cigarettes[choice-1][2]
    if money < moneys:
        print('{}包{}一共需要{}元,钱不够,您还需要额外支付:{}元'.format(count, cigarettes[choice-1][1], moneys, moneys - money))
        money1 = int(input('请付差价:'))
        if money1 < (moneys - money):
            print('就不能一次不清差价吗?')
            money2 = int(input('请付差价:'))
            if money2 < (moneys - money-money2):
                print('别买了,滚出去。。。。。')
        else:
            print('请拿走你的货物,欢迎下次再光临')
    else:
        print('{}包{}一共需要{}元,找零:{}元'.format(count, cigarettes[choice-1][1], moneys, money - moneys))
        print('欢迎下次再光临')
elif choice1 == 'no':
    choices2 = input('用烟换钱吗yes/no?')
    if choices2 == 'yes':
        choices3 = input('通常不管什么烟,我都收2成的手续费,答应吗yes/no?')
        if choices3 == 'yes':
            print('开始交易吧')   # 还可以继续补充
        elif choices3 == 'no':
            print('不干拉倒')
        else:
            print('啥都不干啊')
    else:
        print('那你先看看吧')
else:
    print('想干嘛,不说我就报警了啊')
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值