Jul-21-2018, 01:08 PM
I am trying to limit each sentence to 10 words
file = open("a.txt","r") content = file.read() file.close() file_out = open("out.txt","w+") for i in range(len(content)): file_out.write(content[i]) if (i + 1).join(i.split()[:10]): file_out.write('\n') file_out.close()what would be the correct syntax?
:)
Python newbie trying to learn the ropes