`if 'add'in user_action:
todo = user_action[4:]
todo = todo + "\n"
with open('todos.txt', 'r') as file:
todos = file.readlines()
todos.append(todo)
with open('todos.txt', 'w') as file :
file.writelines(todos)`
this will solve the issue