Read the current inventory from a file.  Either adjust inventory based on orders or generate a purchase of new inventory.  When a product goes below a certain point, it will be asked to calculate it and then restock it to a target point. I am trying to make it more efficient, such as making it shorter.check = 0 GTINCODE = [] PRODUCTDESCRIPTION = [] PRICES = [] CURRENTSTOCK = [] REORDERLEVEL = [] TARGETLEVEL = [] RESTOCKORDER = [] TARGETORDER = [] c=0 count = 0 cfile = none with open(stockfile.txt, r) as newstockfile:     for row in newstockfile:         row = row.strip('\n')         split = row.split(,)          GTINCODE.append(split[0])         PRODUCTDESCRIPTION.append(split[1])         PRICES.append(split[2])         CURRENTSTOCK.append(int(split[3]))         REORDERLEVEL.append(split[4])         TARGETLEVEL.append(split[5]) while check == 0:         menu = input(Do you want to create an order for items below the stock level[1], order items that are out of stock from the order file[2] or quit[3])         if menu == 1:            cfile = no             while c < len(CURRENTSTOCK):                 if int(CURRENTSTOCK[c]) < int(REORDERLEVEL[c]):                     RESTOCKORDER.append(GTINCODE[c])                     TARGETORDER.append(TARGETLEVEL[c])                     count = count + 1                     c = c + 1                     cfile = yes                 else:                     c = c + 1             c = 0             with open (Reorderfile.txt,w) as newstockfile:                print(The reorder file  has been created)                 for c in range (0, count):                             neworderfile.write(str(RESTOCKORDER[c]) + : + str(TARGETORDER[c] + \n))         elif menu == 2:           if cfile == yes:             with open (Reorderfile.txt, r) as neworderfile:                 for row in neworderfile:                     row = row.strip('\n')                     split = row.split(:)                     c = 0                     while i<len(GTINCODE):                         if GTINCODE[c] == split[0]:                             CURRENTSTOCK[c] = split[c]                             c = c + 1                         else:                                                                   c = c + 1                with open(stockfile.txt, w) as newstockfile:                     for c in range (0,len(GTINCODE)):                         newstockfile.write(str(GTINCODE[i]) + : + str(PRODUCTDESCRIPTION[i]) + : + str(PRICES[i]) + : + str(CURRENTSTOCK[i]) + : + str(REORDERLEVEL[i]) + : + str(TARGETLEVEL[i]) + \n)                 print(The products have been restocked)           elif cfile == no:               print(No products are out of stock)          elif cfile == none:               print(The reorder file has not been created)           else:               print(Error)         elif menu == 3:             check = 1             print(Goodbye)         else:             print(Please Try Again)
Calculate product restocks
python