I have 3 inputs:
name = input(">> ")
price = input(">> ")
count = input(">> ")
print("\nDo you want to add more products?")
more = input(">> ")
First of all, I write these three parameters into a file (empty or filled with something nevermind). After the program asks me "Do you want to add more?", if I do not type anything and press enter, then the program will write my answers into a file with this format.
name/price/count
If I press any key and hit enter then the program will continue asking me for 3 more inputs. If I stop after this then the file look will look like this:
name/price/count/name/price/count
And I can continue this sequence as many times as needed.
So far, this is what I have and it it working.
readingWriting("someFile.txt", dataOfInputs)
print("\nSuccessfully!\n")
Question: How can I make this program work as described?