Foundations of Programming (Python)
LAB 06-C: Creating a Class of Functions
In this Lab, we’ll continue with the code from LAB 06-A. You’ll create a class that has our four functions for doing the calculations.
- Make a copy of the script from LAB 06-A and save it as Lab06_C.
- Add code and docstring to create a class called SimpleMath
- Add code and docstring to create a function get_sum
- Add code and docstring to create a function get_diffference
- Add code and docstring to create a function get_product
- Add code and docstring to create a function get_quotient
- Add code for the I/O to capture user input and format your output that it resembles this result:
- Test the script and write down how the code works.
Back to Modules Materials Lists