new_line = "This new line will be added. " with open("sample.txt", "a") as a_file: a_file.write(" ") a_file.write(new_line)