Exercise - Shopping Cart

salaryint(input("please input your salary:"))
shopping_car = []
Commodity_shelves = [["iphone",5800],["macbookpro",12000],["starbuck_latte",30],["Alex_python",81],["bike",800]]
j = 0
 
 
    if salary < price:
        print ( "Your balance is insufficient" )
        print ( "The following items have been added to your cart:" , shopping_car)
        break
    elif buy == 100:
        break
    else:
        shopping_car.append(Commodity_shelves[buy][0])
        salary -= price
        print ( "The following items have been added to your shopping cart:" ,shopping_car)
        print ( "Your balance is: " , salary )
    j = 0

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324812269&siteId=291194637