I just had a quick question that keeps breaking my program. For some reason file.write() will only take in 1 string or variable and my question is there any way around this?
For example Im asking if it is possible to write multiple variables or strings to a file at once. Like this but without .write() because it doesn't allow you to.
file.write("apples: ", numApples, "\n oranges: ", numOranges)
Any help or suggestions are welcome!
The best answer I thought of right now is to make it all a string then send it to the file.
file.write("apples: " + str(numApples) + "\n oranges: " + str(numOranges))