# 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('想干嘛,不说我就报警了啊')
列表和循环练习 2
最新推荐文章于 2024-07-26 21:19:18 发布