Summary
We've covered string manipulation, file IO, and object serialization. We discussed how to combine hard-coded strings and program variables into outputtable strings using the powerful string formatting system, and learned the difference between binary and textual data. All told, we've seen:
How to use the various
str
methodsString formatting
bytes
versusstr
Mutable
bytearrays
Files in binary and textual formatters
Context managers and the
with
statementSerializing data with
pickle
andjson
In the next chapter, we'll cover one of the most important topics in Python programming: how to test our code to ensure it's doing what we think it is doing.