diff options
| author | Christian Kolset <christian.kolset@gmail.com> | 2025-12-03 15:50:47 -0700 |
|---|---|---|
| committer | Christian Kolset <christian.kolset@gmail.com> | 2025-12-03 15:50:47 -0700 |
| commit | 5b9fd00087ca8594ddb716134cd210a9f9ae5876 (patch) | |
| tree | 8fbbaee2ba680ae3d3116abede779c7f834c9b53 /tutorials | |
| parent | 7a713b1e67a255c285eef45d172ba0a1286987c3 (diff) | |
Made some updates to older files and renamed files. Also updated README.md
Diffstat (limited to 'tutorials')
| -rw-r--r-- | tutorials/module_1/basics_of_python.md | 13 | ||||
| -rw-r--r-- | tutorials/module_1/classes_and_objects.md | 33 | ||||
| -rw-r--r-- | tutorials/module_1/control_structures.md | 2 | ||||
| -rw-r--r-- | tutorials/module_4/4.1_Introduction_to_Data_and_Scientific_Datasets.md (renamed from tutorials/module_4/4.1 Introduction to Data and Scientific Datasets.md) | 0 | ||||
| -rw-r--r-- | tutorials/module_4/4.2_Interpreting_Data.md (renamed from tutorials/module_4/4.2 Interpreting Data.md) | 0 | ||||
| -rw-r--r-- | tutorials/module_4/4.3_Importing_and_Managing_Data.md (renamed from tutorials/module_4/4.3 Importing and Managing Data.md) | 0 | ||||
| -rw-r--r-- | tutorials/module_4/4.4_Statistical_Analysis.md (renamed from tutorials/module_4/4.4 Statistical Analysis.md) | 0 | ||||
| -rw-r--r-- | tutorials/module_4/4.5_Statistical_Analysis_II.md (renamed from tutorials/module_4/4.5 Statistical Analysis II.md) | 0 | ||||
| -rw-r--r-- | tutorials/module_4/4.6_Data_Filtering_and_Signal_Processing.md (renamed from tutorials/module_4/4.6 Data Filtering and Signal Processing.md) | 0 | ||||
| -rw-r--r-- | tutorials/module_4/4.7_Data_Visualization_and_Presentation.md (renamed from tutorials/module_4/4.7 Data Visualization and Presentation.md) | 0 |
10 files changed, 37 insertions, 11 deletions
diff --git a/tutorials/module_1/basics_of_python.md b/tutorials/module_1/basics_of_python.md index 80b05d3..8dcd37b 100644 --- a/tutorials/module_1/basics_of_python.md +++ b/tutorials/module_1/basics_of_python.md @@ -1,19 +1,16 @@ # Basics of Python - -^d2a6b6 - -This page contains important fundamental concepts used in Python such as syntax, operators, order or precedence and more. +This page contains important fundamental concepts and terminology used in Python such as syntax, operators, order or precedence and more. Although this course uses python, many of these terms are transferable to other programming languages. ## Syntax +Syntax in Python works like grammar in natural languages: it defines the rules for how we must arrange words, symbols, and indentation so the code becomes a valid instruction. ### Indentations and blocks In python *indentations* or the space at the start of each line, signifies a block of code. This becomes important when we start working with function and loops. We will talk more about this in the controls structures tutorial. - ### Comments -Comments can be added to your code using the hash operator (#). Any text behind the comment operator till the end of the line will be rendered as a comment. -If you have an entire block of text or code that needs to be commented out, the triple quotation marks (""") can be used. Once used all the code after it will be considered a comment until the comment is ended with the triple quotation marks.f +Comments can be added to your code using the hash operator (`#`). Any text behind the comment operator till the end of the line will be rendered as a comment. +If you have an entire block of text or code that needs to be commented out, the triple quotation marks (`"""`) can be used. Once used all the code after it will be considered a comment until the comment is ended with the triple quotation marks. ## Operators -In python, operators are special symbols or keywords that perform operations on values or variables. This section covers some of the most common operator that you will see in this course. +Operators are special symbols or keywords that perform operations on values or variables. This section covers some of the most common operator that you will see in this course. ### Arithmetic operators | Operator | Name | diff --git a/tutorials/module_1/classes_and_objects.md b/tutorials/module_1/classes_and_objects.md index 759a3a3..ba1dab9 100644 --- a/tutorials/module_1/classes_and_objects.md +++ b/tutorials/module_1/classes_and_objects.md @@ -42,6 +42,31 @@ - D. Bonus: Integrate two objects to simulate interaction --- +# Background +To understand what modular programming is and why using it, let's take a look a the origin of computer code. +# Traditional Programming +Procedural Oriented Programming. + +| OOP | POP | +| ---------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | +| [Object oriented](https://www.geeksforgeeks.org/dsa/introduction-of-object-oriented-programming/). | [Structure oriented](https://www.geeksforgeeks.org/computer-networks/difference-between-structured-programming-and-object-oriented-programming/). | +| Program is divided into objects. | Program is divided into functions. | +| Bottom-up approach. | Top-down approach. | +| Inheritance property is used. | Inheritance is not allowed. | +| Encapsulation is used to hide the data. | No data hiding. | +| Concept of virtual function. | No virtual function. | +| Object functions are linked through message passing. | Parts of program are linked through parameter passing. | +| Adding new data and functions is easy | Expanding new data and functions is not easy. | +| The existing code can be reused. | No code reusability. | +| use for solving big problems. | Not suitable for solving big problems. | +| Python, [C++](https://www.geeksforgeeks.org/cpp/c-plus-plus/), [Java](https://www.geeksforgeeks.org/java/java/). | [C](https://www.geeksforgeeks.org/c/c-programming-language/), Pascal. | + + +https://www.geeksforgeeks.org/cpp/difference-between-oop-and-pop/ +## POP vs. OOP + + + # Modular Programming Modular programming or better known as Object-Oriented Programming (OOP) is a way we can structure programs so that properties and behaviors of objects are grouped together. It allows us to re-use code which simplifies the code for better readability in larger programs and reduces the potential for bugs. You're probably familiar with the saying "Don't re-invent the wheel". OOP is the programmers solution to this. Python allows us to import libraries so that we don't have to write everything from scratch. The libraries used in this course provide us with algorithms to calculate a solution, structure data and plot data. When looking at the source code of these library you may see keywords, such as `class`. This tutorial will delve into the fundamental concepts of OOP. @@ -51,6 +76,10 @@ One analogy for OOP goes as follows. Imagine you are an urban planner in the tow #### Objects Once we have the general structure of what a house is going to look like, we can use this blueprint to start building houses faster. With this blueprint defined. We can start building houses from the blueprint. In python we call this *initializing objects*. Where an actual house built from this blueprint with specific attributes (e.g. house #305, blue house, single-hung window, attached garage) is referred to as an `object`. +>[!NOTE] Difference between functions and objects +> **Functions:** A procedure. Such as a force. +> **Objects:** Include properties. Such as a spring, with a defined spring constant. + #### Example Let's take a look at an example. Of how this looks like in python. Do not worry if you don't understand the syntax below, we will explain this later. Let's define the class: ```python @@ -270,4 +299,6 @@ Notice how the `__init__` method defaults the inputs`breed="Mixed"` and `age=1` ```python -```
\ No newline at end of file +``` + +https://eng.libretexts.org/Courses/Arkansas_Tech_University/Engineering_Modeling_and_Analysis_with_Python/01%3A_Introduction_to_Engineering_Modeling_and_Analysis_with_Python
\ No newline at end of file diff --git a/tutorials/module_1/control_structures.md b/tutorials/module_1/control_structures.md index 68db0c5..5b222ce 100644 --- a/tutorials/module_1/control_structures.md +++ b/tutorials/module_1/control_structures.md @@ -1,7 +1,5 @@ # Control Structures -^e8fcff - Control structures allow us to control the flow of execution in a Python program. The two main types are **conditional statements (`if` statements)** and **loops (`for` and `while` loops)**. [Input complete flowchart here] diff --git a/tutorials/module_4/4.1 Introduction to Data and Scientific Datasets.md b/tutorials/module_4/4.1_Introduction_to_Data_and_Scientific_Datasets.md index 882ce59..882ce59 100644 --- a/tutorials/module_4/4.1 Introduction to Data and Scientific Datasets.md +++ b/tutorials/module_4/4.1_Introduction_to_Data_and_Scientific_Datasets.md diff --git a/tutorials/module_4/4.2 Interpreting Data.md b/tutorials/module_4/4.2_Interpreting_Data.md index bbb4240..bbb4240 100644 --- a/tutorials/module_4/4.2 Interpreting Data.md +++ b/tutorials/module_4/4.2_Interpreting_Data.md diff --git a/tutorials/module_4/4.3 Importing and Managing Data.md b/tutorials/module_4/4.3_Importing_and_Managing_Data.md index 91411c6..91411c6 100644 --- a/tutorials/module_4/4.3 Importing and Managing Data.md +++ b/tutorials/module_4/4.3_Importing_and_Managing_Data.md diff --git a/tutorials/module_4/4.4 Statistical Analysis.md b/tutorials/module_4/4.4_Statistical_Analysis.md index f61caa9..f61caa9 100644 --- a/tutorials/module_4/4.4 Statistical Analysis.md +++ b/tutorials/module_4/4.4_Statistical_Analysis.md diff --git a/tutorials/module_4/4.5 Statistical Analysis II.md b/tutorials/module_4/4.5_Statistical_Analysis_II.md index 20805c9..20805c9 100644 --- a/tutorials/module_4/4.5 Statistical Analysis II.md +++ b/tutorials/module_4/4.5_Statistical_Analysis_II.md diff --git a/tutorials/module_4/4.6 Data Filtering and Signal Processing.md b/tutorials/module_4/4.6_Data_Filtering_and_Signal_Processing.md index 74b7cb0..74b7cb0 100644 --- a/tutorials/module_4/4.6 Data Filtering and Signal Processing.md +++ b/tutorials/module_4/4.6_Data_Filtering_and_Signal_Processing.md diff --git a/tutorials/module_4/4.7 Data Visualization and Presentation.md b/tutorials/module_4/4.7_Data_Visualization_and_Presentation.md index f97721b..f97721b 100644 --- a/tutorials/module_4/4.7 Data Visualization and Presentation.md +++ b/tutorials/module_4/4.7_Data_Visualization_and_Presentation.md |
