Session 12

Practice Python (PP) Exercise 1, 2, 3, 4, 5, 6, 7, 8

These exercises are great for building confidence with some of the basic tools taught in LPTHW. They are very simple, but can often be solved multiple ways. Usually, when I do these exercises, I try to:

  1. Solve the problem by any means necessary
  2. Solve the problem in alternate ways
  3. Build functions around my solutions
  4. Build classes around my solutions

Many of these exercises are pretty basic and don’t require functions / classes, but it’s good practice!

Also, one of these exercises (#6) showed me how to iterate over or slice a string. Until this exercise, I hadn’t even realized that was possible. Definitely a useful trick.

Finally, Jeff Knupp’s blogĀ https://jeffknupp.com/blog/2014/06/18/improve-your-python-python-classes-and-object-oriented-programming/ has proven to be really helpful for some of the more complicated topicsĀ (for me) like classes. I definitely recommend checking it out.