f = open("open","rw")
w = open("write","w")
def fonk():
c = ""
a = f.readline().decode('utf-8')
for line in f:
b = line.decode('utf-8')
splitted = line.split()
w.write("'"+splitted[4:]+"'"+",")
fonk()
I want to read words of file called "open" and write it to another file called "write". I can write the 4th character but I want to write 4 and more in this case I get the error on the title. What should I do?
"'"string,splitted[4:]list. tryw.write("'"+''.join(splitted[4:])+"'"+",")