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 methods
  • String formatting
  • bytes versus str
  • Mutable bytearrays
  • Files in binary and textual formatters
  • Context managers and the with statement
  • Serializing data with pickle and json

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.

Get Python 3 Object Oriented Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.