Changes

Jump to: navigation, search

OPS435 Python Lab 5

19 bytes added, 15:48, 22 September 2017
PART 1 - Reading Data From Files
</source>
<blockquote>{{Admon/tip|style="padding-left:25px"|Creating a List of Stripped Lines of Text|A common (and preferred) method to store a list of stripped text (by line) is to use a store file contents into a variable, then use a loop to grow (i.e. "append") each stripped line. There are a couple of important things to note:<ol><li>You need to initialize the list as empty (eg. '''new-list&#61;[]''')</li><li>Use the '''append()''' function to grow each line (using the '''strip()''' function) within the loop</li></ol>}}</blockquote>
=== Create a Python Script Demonstrating Reading Files ===
13,420
edits

Navigation menu