Hi all -
I need to write a code that reads in a 20 line file 4 lines at a time, and puts the five sets of 4 strings into their own individual strings. So there should be five strings containing 4 strings each.
I am very confused and havne't gotten very far in the code..
myFile = open("lab12.txt","r")
myOut = open("out.txt","w")
line1 = myFile.readline()
myString = ()
while line1 != "":
line2 = myFile.readline()
line3 = myFile.readline()
line4 = myFile.readline()
myString = (line1,line2,line3,line4)
myOut.write(myString)
line1 = myFile.readline()
myOut.close()
myFile.close()