Saravji's Hut

Logo

The place where change happens.

Project on GitHub Saravji/saravjis_hut

Saravji's Hut YouTube channel

Saravji on Twitter

Foundations of Programming (Python)

LAB 08-D: Working with properties:

In this Lab, we’ll add properties to the class we created in Lab 08-C.

  1. Make a copy of Lab08_C.py and save it as Lab08_D.py
  2. Add code to create properties (setters and getters) for all three attributes.
  3. Add code to verify the validity of the values.
  4. Test the class and make sure it works.

One note about testing: Make sure to test that the script works as expected (with ‘good’ values).
But also think about what values to use to test that you can’t break your script.
These tests typically are more efficient.

Back to Modules Materials Lists