summaryrefslogtreecommitdiff
path: root/tutorials/module_1/notebook_1/classes_and_objects.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'tutorials/module_1/notebook_1/classes_and_objects.ipynb')
-rw-r--r--tutorials/module_1/notebook_1/classes_and_objects.ipynb31
1 files changed, 25 insertions, 6 deletions
diff --git a/tutorials/module_1/notebook_1/classes_and_objects.ipynb b/tutorials/module_1/notebook_1/classes_and_objects.ipynb
index f21002b..b74c189 100644
--- a/tutorials/module_1/notebook_1/classes_and_objects.ipynb
+++ b/tutorials/module_1/notebook_1/classes_and_objects.ipynb
@@ -13,9 +13,30 @@
"- C. Real-world analogies (e.g., modeling components like pumps,\n",
" motors, or vehicles)\n",
"\n",
- "| \\## 2. Core OOP Concepts - A. **Classes and Objects** - Definitions - Syntax in Python - B. **Attributes and Methods** - Instance variables - Functions inside classes - C. **Encapsulation** - Public vs private variables - Using `__init__` and `self` - D. **Inheritance** - Parent and child classes - Reuse and extension of code - E. **Polymorphism** *(brief overview)* - Method overriding - Flexibility in interfaces |\n",
- "|----:|\n",
- "| \\## 3. Python OOP Syntax and Examples - A. Define a simple class (e.g., `Spring`) - B. Instantiate objects and use methods - C. Show `__init__`, `__str__`, custom methods - D. Add a derived class (e.g., `DampedSpring` inherits from `Spring`) |\n",
+ "## 2. Core OOP Concepts\n",
+ "\n",
+ "- A. **Classes and Objects**\n",
+ " - Definitions\n",
+ " - Syntax in Python\n",
+ "- B. **Attributes and Methods**\n",
+ " - Instance variables\n",
+ " - Functions inside classes\n",
+ "- C. **Encapsulation**\n",
+ " - Public vs private variables\n",
+ " - Using `__init__` and `self`\n",
+ "- D. **Inheritance**\n",
+ " - Parent and child classes\n",
+ " - Reuse and extension of code\n",
+ "- E. **Polymorphism** *(brief overview)*\n",
+ " - Method overriding\n",
+ " - Flexibility in interfaces\n",
+ "\n",
+ "## 3. Python OOP Syntax and Examples\n",
+ "\n",
+ "- A. Define a simple class (e.g., `Spring`)\n",
+ "- B. Instantiate objects and use methods\n",
+ "- C. Show `__init__`, `__str__`, custom methods\n",
+ "- D. Add a derived class (e.g., `DampedSpring` inherits from `Spring`)\n",
"\n",
"## 4. Engineering Applications of OOP\n",
"\n",
@@ -24,8 +45,6 @@
"- B. Creating reusable components (e.g., `Material`, `Beam`, `Force`)\n",
"- C. Organizing simulation code with OOP\n",
"\n",
- "------------------------------------------------------------------------\n",
- "\n",
"## 5. Hands-On Coding Activity\n",
"\n",
"- A. Write a class for a basic physical component (e.g., `Motor`)\n",
@@ -33,7 +52,7 @@
"- C. Extend with inheritance (e.g., `ServoMotor`)\n",
"- D. Bonus: Integrate two objects to simulate interaction"
],
- "id": "8358dbad-84d7-4413-ae4a-bd5eedae2a3b"
+ "id": "3440ae51-dc28-4d79-8abe-3ed2c35686eb"
}
],
"nbformat": 4,