Changes

Jump to: navigation, search

OPS435 Python Lab 5

8 bytes added, 17:30, 4 September 2017
PART 1 - Reading Data From Files
:#Let's re-issue the following command:<source lang="python">
read_data
</source><br>This command displays the data from the file in a single <u>long</u> string. The end of each line in the file will show the special character ''''\n'''' which represents the '''newline character''' in a file used to separate lines (or records in a traditional "flat database file"). It would be convenient to '''split''' the line on the new-line characters, so each line can be stored into a separate array elements (or in our case, a list!).<br><br>
:#First issue the following commands to get help on the '''split''' method:<source lang="python">
dir(read_data)
13,420
edits

Navigation menu