Im a lumberjack and Im okay I sleep all night and I work all

I\'m a lumberjack and I\'m okay, I sleep all night and I work all day. He\'s a lumberjack and he\'s okay,

***PLEASE WRITE OUT THE EXCAT CODE OR SCREEN SHOT FROM PYTHON**** (NO UNNECESSARY WORDS PLEASE)

Problem 2: You are given a test file named as testFile.txt with a single sentence of 20 words. Read the file, then insert carriage return characters (n and write the test to a new text file that will be composed of four lines of five words Sample output of new text file: newFile txt I\'m a lumberjack and I\'m okay, I sleep all night and I work all day. He\'s a lumberjack and he\'s okay,

Solution

f = open(\"testFile.txt\",\'r\')
line = f.readline()
line = line.split()
out = open(\"newTextFile.txt\",\'w\')

out.write(\" \".join(line[0:5])+\"\ \")
out.write(\" \".join(line[5:10])+\"\ \")
out.write(\" \".join(line[10:15])+\"\ \")
out.write(\" \".join(line[15:20])+\"\ \")

I\'m a lumberjack and I\'m okay, I sleep all night and I work all day. He\'s a lumberjack and he\'s okay, ***PLEASE WRITE OUT THE EXCAT CODE OR SCREEN SHOT FROM

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site