code is given below. when I'm adding more items after running in loop it takes only first item in file and rest not. so please
code is given below. when I'm adding more items after running in loop it takes only first item in file and rest not. so please help me. thank you import datetime def gettime(): return datetime.datetime.now() print("CUSTOMER RATION BORROWING MANAGEMENT") print("what do you want?\n 1. Log \n2.Retrieve") d = int(input()) if (d==1): name = (input("Enter customer name\n----")) while (True): grocerry = str(input("items\n----")) price = (input("enter price\n----")) a = str(input("Want to add more items?\ny for Yes -- n for No\n")) if (a=="y"): continue else: break with open (f"{name}.txt","a",) as name: name.write (str([str(gettime())])+" :- "+grocerry+":- "+str(price)+"\n") print("Noted successfully.....") else: name = str(input("Enter customer name\n")) with open (f"{name}.txt") as name: for i in name: print(i,end="")