You are on page 1of 1

Current_Stock = int(input("Please enter an initial stock level: "))

Plan_Months = int(input("Please enter the number of month to plan: "))


planned_sales = []
prod_qty = []

for i in range(0, Plan_Months):


planned_sales_element = int(input("Please enter the planned sales quantity: "))
planned_sales.append(planned_sales_element) # adding the element

print("")
print("The resulting production quantities are:")

for i in range(0, Plan_Months):


prod_qty_element = Current_Stock - planned_sales_element

#If the sales quantity is smaller than the stock level of the previous month,
#the production quantity is 0
if planned_sales[i] <= Current_Stock:
prod_qty_element = 0
Current_Stock = Current_Stock - planned_sales[i]
else:
#If the sales quantity is larger than the stock level of the previous month,
#the production quantity is this difference
prod_qty_element = planned_sales[i] - Current_Stock
Current_Stock = 0

prod_qty.append(prod_qty_element) # adding the element

print("Production quantity month", i+1, ":", prod_qty_element)

#print(planned_sales)
#print(prod_qty)

You might also like