Question: what is the major difference between writing and appending to text files in python?
Answer: - Both mode write the content in the file, if file not exist then they create that file. - for a existing file, - write mode 'w' erase the previous data of the file and insert new data while append mode don't erase previous data, it append new data with previous one.