I am trying to make a program that will put the output of the user into a text file. What I want to do is have the text printed on multiple lines, not the same line. For example, if the UserName variable is set to "User":
UserName = input('What is your name?: ')
with open('Results ' + UserName, 'w') as WriteFile:
WriteFile.write('Results for ' + UserName)
with open('Results ' + UserName, 'a') as WriteFile:
WriteFile.write(' If this text is shown on another line, it means this was a success.')
The output would be:
Results for User If this text is shown on another line, it means this was a success.
How could I make the output say:
Results for User
If this text is shown on another line, it means this was a success.