set the name of CSV file in local directory, initialise 3 x parallel arrays, open the file to read using with. This ensures that the file is properly closed when the code block is exited, reads all the lines from the opened file and stores them as a list of strings in the lines variable, iterate lines, each line is split into individual elements using a comma (,) as the separator. The [:-1] slice is used to remove the trailing newline character from each line, append the elements from each line to their respective arrays.

SDD Implementation (File IO) 2

Leaderboard

Visual style

Options

Switch template

Continue editing: ?