Answer the question
In order to leave comments, you need to log in
How to pack a list into a list in Python?
Hello.
There is a dictionary in the list:
"items": [
{
"name": "ФЛУР.ДЕЛЮКС ШОК-КЛУБ",
"price": 9900,
"sum": 9900,
"quantity": 1,
"paymentType": 4,
"productType": 1,
"nds": 2
},
{
"name": "ЛИМОНАД САНТОРИНИ",
"price": 7900,
"sum": 7900,
"quantity": 1,
"paymentType": 4,
"productType": 1,
"nds": 1
},
{
"name": "СПРАЙТ БОЛЬШОЙ",
"price": 7500,
"sum": 7500,
"quantity": 1,
"paymentType": 4,
"productType": 1,
"nds": 1
},
{
"name": "ФЛУРРИ ДЕЛЮКС ШОК-КАР",
"price": 9900,
"sum": 9900,
"quantity": 1,
"paymentType": 4,
"productType": 1,
"nds": 2
}
]
for item in files["items"]:
name_product = item["name"]
price = str(get_result_price(item["price"]))
quantity = str(item["quantity"])
amount = str(get_result_price(item["sum"]))
for item in files["items"]:
name_product = item["name"]
price = str(get_result_price(item["price"]))
quantity = str(item["quantity"])
amount = str(get_result_price(item["sum"]))
information_products.append(name_product)
information_products.append(price)
information_products.append(quantity)
information_products.append(amount)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question