I need help and am a beginner programmer, how are we meant to make sure that the previous function calls values are first saved to the txt and that the next time the function is called it writes on the next line?
def add_employee(name, id, date_joined, job):
with open('employees.txt', 'w+') as txtfile:
line = 'ID: {0} --- Name: {1} --- Date_Joined: {2} --- Job: {3}'.format(id, name, date_joined, job)
txtfile.write(line)
txtfile.close()