Python为每个列表(商店)分配/分配编号(库存)

时间:2019-02-28 21:27:25

标签: python append allocation inventory

我有库存,想分配或分配给每个列表(商店) 1.我的最低库存= 5 #condition 2. 5家商店将各有40个,第1家商店将剩1个。

ttl_stock = 201
stores = [1,2,3,4,5]
minimum_stock = 5 #this is a condition

while ttl_stock > minimum_stock:
    for store in range(len(stores)):
        ttl_stock -=5
        minimum_stock= 5

我想给每个商店加5,并且在ttl_stock数量小于minimum_stock时需要中断,然后为每个商店加+ = 1。 另外,我需要对for循环后的每个商店的库存求和。

1 = 41
2 = 40
3 = 40
4 = 40
5 = 40

如何将这些号码发送到每个商店? 我不知道应该在python中使用哪个功能 如果您对此有任何想法,请告诉我!

0 个答案:

没有答案