1

i don't know how to separate lines in a text file in python. What i mean is that i want to write a text file with some values that the user can put in input (and this is the easy part) but i also want that every value that the user put in input is properly separate in the txt file (so basically on different lines) This is the code that i wrote:

   file= open("txt.txt", "w")
   Value1 = input("value1: ")
   Value2 = input("value2: ")
   file.write(Value1)
   file.write(Value2)

   file.close()

When i check the txt.txt file the values are on the same line... anyone knows what i can do to have Value1 and Value2 on different lines?

JonnyJoe
  • 11
  • 1

0 Answers0