Update S6: Object Oriented Programming authored by Rodrigo's avatar Rodrigo
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# Session 6: Object Oriented Programming # Session 6: Object Oriented Programming
* **Time**: 2h * **Time**: 2h
* **Date**: XXXX, XX-XX-2023
* **Goals**: * **Goals**:
* Understand how Classes (new concept to acquire) work * Understand how Classes (new concept to acquire) work
* Create our first Class * Create our first Class
...@@ -42,7 +43,7 @@ On the contrary, the [object oriented paradigm](https://en.wikipedia.org/wiki/Ob ...@@ -42,7 +43,7 @@ On the contrary, the [object oriented paradigm](https://en.wikipedia.org/wiki/Ob
## Working with sequences and functions ## Working with sequences and functions
In the previous session we developed our own **library of functions** (Seq0) for working with sequences. As an example let's use a modified version of that library (some input parameters are different) to perfor some simple calculations on the sequence "ATTCCCGGGG". Save this example in the folder **S06** and call it **test-01.py**. In the previous session we developed our own **library of functions** (Seq0) for working with sequences. As an example let's use a modified version of that library (some input parameters are different) to perform some simple calculations on the sequence "ATTCCCGGGG". Save this example in the folder **S06** and call it **test-01.py**.
```python3 ```python3
from Seq0 import * from Seq0 import *
...@@ -173,7 +174,7 @@ The **methods** are the **actions** that the objects can perform. The first meth ...@@ -173,7 +174,7 @@ The **methods** are the **actions** that the objects can perform. The first meth
class Seq: class Seq:
"""A class for representing sequences""" """A class for representing sequences"""
def __init__(self): def __init__(self):
print("New sequence created!") print("New sequence created!") # I would not consider a good practice printing here but...
# Main program # Main program
... ...
......