In-Class Exercise: Introduction to Classes
The following exercises will have you create and use Python classes. You will define classes with attributes and methods, validate input, and practice inheritance. The examples use civil engineering contexts including students, construction vehicles, and concrete mix design.
You can find the In Class Exercise here:
Instructions
- Open the in-class workbook using the link above.
- Rename the notebook something like "(Your_Name)_Class_Intro_Classes.ipynb".
- Part of the exercise has you upload two Python module files to Colab and import them. Download them here: car.py and electric_car.py.
- Follow the instructions in the notebook to complete the exercises. Exercise 1 is a guided walkthrough. Exercises 2 and 3 are independent practice.
Turning in/Rubric
REMINDER - For this class, you will only turn in the links to your colab notebooks. You will get a 0 for this assignment if you turn in a python file or a link that is not correct, wrong assignment, or does not give editor permission.
Rubric:
| Item | Points Possible |
|---|---|
Total |
5 |
The following is not a part of the rubric, but specifies how you can lose points. For example: if you fail to share your link correctly.
| Reasons for Points Lost | Amount |
|---|---|
| Link shared incorrectly | -10% |
| Turned in late (per week) | -10% (up to -50%) |