I have a text file, I want to read this text file into 3 different arrays, array1 array2 and array3. the first paragraph gets put in array1, the second paragraph gets put in arr
Using slices would also work.
par_separator = "\n\n" paragraphs = "1\n\n2\n\n3\n\n4\n\n5\n\n6".split(par_separator) a,b,c = paragraphs[0:len(paragraphs):3], paragraphs[1:len(paragraphs):3],\ paragraphs[2:len(paragraphs):3]
Within slice: [start index, end index,step]