13,420
edits
Changes
→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=[]''')</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 ===