I'm using this function to take a file in a list:
def read_file_in_list (file_name):
list = []
with open (file_name,'r') as file:
for line in file:
lista.append ("\n")
for word in line.split():
list.append (" ")
list.append(word)
file.close()
return list
I have to modify this list and write that in another file.
This code doesn't keep the tabulation. How can I solve this issue?