Python Sequences and Files
Posted on Apr 25th, 2022
We can use the generic term sequence for any object that provides an ordered structure for a number of items, such as a string (a group of characters), a list, or a dictionary (keys and values).
Files are important as inputs for our programs. Today we’ll learn about working with text files.
📅 Today’s Topics
- More strings
- Working with files
- List comprehensions
🐍 Code Break
🎯 Project
We will work on this project in stages both inside and outside of class today. It is due on Tuesday morning.
You will find this helpful in understanding the starter code.
- What does
if __name__ == "__main__"
do? And these for reading the files. - Working with Files in Python
- Reading and Writing Files
🔖 Resources
RealPython
Python Docs
🦉 Code & Notes
- Python List Comprehensions
- Working With Files
- Intro to Python notebooks (Notebooks 6-9)