I'd like to make this code better by creating a loop able to create variable depending on the item of the list
#Price for 100
price_100 = pack['100']['product_price']
shipping_100 = pack['100']['shipment_price']
total_price_100 = price_100 + shipping_100
print(total_price_100)
#Price for 200
price_200 = pack['200']['product_price']
shipping_200 = pack['200']['shipment_price']
total_price_200 = price_200 + shipping_200
print(total_price_200)
#etc etc etc until 1000
I thought of creating a loop like this one:
list_quantity = ['100', '200', '300', '400', '500', '600', '700', '800', '900', '1000']
for i in list_quantity:
price = pack[i]['product_price']
#I want to create a variable called shipping + '_' + i (e.g. price_100) for each iteration
shipping = pack[i]['shipment_price']
#Same here, a variable called shipping + '_' + i (e.g shipping_100)
total_price = price + shipping
print(total_price)