Learning the Basics of Python

Strings

Files

  • James Mertz. Reading and Writing Files in Python (Guide). Real Python.
    • Covers paths, line endings, character encodings, opening and closing, text/binary/raw file types, iterating over lines, working with bytes, __file__, etc.
  • Vuyisile Ndlovu. Working with Files in Python. Real Python.
    • Covers “with open(…) as …”, directory listings, file attributes, creating directories, filename pattern matching, directory traversal, temporary files/dirs, deleting/copying/moving/renaming, archiving, etc.

Conditionals / Branching

  • John Sturtz. Python “for” Loops (Definite Iteration). Real Python.
    • Covers numeric range, three-expression, and collection-based or iterator-based loops; iterating through a dictionary, the range function, break/continue statements, and the else clause.