salary = int(input("Please input your salary: "))
msg = '''
1. iphone6s 5800
2. mac book 9000
3. coffee 32
4. python book 80
5. bicyle 1500
6. exit
'''
cart = []
flag = True
while flag:
print(msg)
tmp = int(input("what do you want to buy?"))
if tmp == 1 and salary >= 5800:
cart.append("iphone6s")
salary = salary - 5800
print("your balance is still has %d" %salary)
elif tmp == 2 and salary >= 9000:
cart.append("mac book")
salary = salary - 9000
print("your balance is still has %d" %salary)
elif tmp == 3 and salary >= 32:
cart.append("coffee")
salary = salary - 32
print("your balance is still has %d" %salary)
elif tmp == 4 and salary >= 80:
cart.append("python book")
salary = salary - 80
print("your balance is still has %d" %salary)
elif tmp == 5 and salary >= 1500:
cart.append("bicyle")
salary = salary - 1500
print("your balance is still has %d" %salary)
elif tmp == 6:
flag = False
else:
print("You don't have enough money")
else:
print("Your shopping cart has", cart)