this is my program so far
End

]
array = []
amount_of_stock_left = []
print("Welcome to Terence's store, we sell the following items : ")
import csv
with open('Productlist task3.csv')as csvfile:
reader = csv.reader(csvfile)
for row in reader:
print(row)
while True:
fileopener=open("Productlist task3.csv")
for line in fileopener:
End.append(line)
fileopener.close()
sum1=len(End)
print("Please input the gtin product code for the item you wish to purchase")
usersGTIN=input()
for i in range(sum1):
line=End[i]
sum2=line.split(",")
cost=sum2[2]
if sum2[0]==usersGTIN:
sum2[2]=float(sum2[2])
cost=(sum2[2])
product=(sum2[1])
GTIN8=(sum2[0])
stocklevel=int(sum2[3])
print("You have selected:",product)
quantity = int(input("How many of this item do you want to purchase?: "))
final_price=float(quantity*cost)
quantity=int(quantity)
final_price=float(final_price)
GTIN8=int(GTIN8)
wouldyouliketopurchaseanotherproduct = input("Would you like to add another item to your order y/n: ")
if wouldyouliketopurchaseanotherproduct == "y":
continue
elif wouldyouliketopurchaseanotherproduct == "n":
amount_of_stock_left=(stocklevel-quantity)
print((amount_of_stock_left),'left of stock remaining')
https://gyazo.com/590a490be3479a6e 70e772a6e0b7 7f46 (remove spaces) excel file
https://gyazo.com/b359beb1f939ec0dd 6d588354b989 27a (remove spaces) excel file
the output of code-
https://gyazo.com/49e 821e3b3f73ddf2c0d615 18134f40a (remove spaces) excel file
i need help on the file, on how to import the data into the excel file (modify it) so that the current stock level amount is changed.If the Current stock level is less than or equal to 5 for example (using yoghurt as example, see screenshot for more info) it would automatically change the current stock to 15 due to being target stock level.
please help