Press the **step over** option twice. On the variable panel we will see the **two new objects** created: **s1** and **s2**. Notice that they both are of **type Seq**:
Press the **step over** option twice. On the variable panel we will see the **two new objects** created: **s1** and **s2**. Notice that they both are of **type Seq**:
Congrats! You have created your first two **empty objects**!
Congrats! You have created your first two **empty objects**!
...
@@ -218,7 +218,7 @@ s2 = Seq("CGTAAC")
...
@@ -218,7 +218,7 @@ s2 = Seq("CGTAAC")
If you **execute** it, you will see the **same output** as before, but now something has happened. The two objects created have their own **sequence string** stored in the **strbases** attribute. Let's debug it to see it.
If you **execute** it, you will see the **same output** as before, but now something has happened. The two objects created have their own **sequence string** stored in the **strbases** attribute. Let's debug it to see it.
Each object has **its own sequence**! If you **debug** it using the **step into** option, you will see that the sequence is stored in the object when the **self.strbases = strbases** line is executed.
Each object has **its own sequence**! If you **debug** it using the **step into** option, you will see that the sequence is stored in the object when the **self.strbases = strbases** line is executed.
...
@@ -443,11 +443,11 @@ Gene: FRAT1-CGTAAC
...
@@ -443,11 +443,11 @@ Gene: FRAT1-CGTAAC
If you have a look to the right side of the \__str_\_ method in the **Gene Class**, you will notice a new icon: a **circle with an arrow** pointing upwards. This means that this methods is **overriding** another implemented in the super class (Seq).
If you have a look to the right side of the \__str_\_ method in the **Gene Class**, you will notice a new icon: a **circle with an arrow** pointing upwards. This means that this methods is **overriding** another implemented in the super class (Seq).
On the other hand, if you have a look at the \__str_\_ method in the **Seq Class**, you will see the previous icon and a **new one** with another circle and **arrow pointing downwards**.
On the other hand, if you have a look at the \__str_\_ method in the **Seq Class**, you will see the previous icon and a **new one** with another circle and **arrow pointing downwards**.
This means that there is a **sub-class** that is overriding this method. And that the Seq \__str_\_ method is also overriding another one from its **super class** (generic).
This means that there is a **sub-class** that is overriding this method. And that the Seq \__str_\_ method is also overriding another one from its **super class** (generic).
...
@@ -465,17 +465,17 @@ termcolor.cprint("Hey! this is printed in green!", 'green')
...
@@ -465,17 +465,17 @@ termcolor.cprint("Hey! this is printed in green!", 'green')
You will see that the word **termcolor** is underlined in **red**. This is because PyCharm does not know anything about the termcolor module.
You will see that the word **termcolor** is underlined in **red**. This is because PyCharm does not know anything about the termcolor module.
Click on the **install package termcolor** option. The package start the installation. After some seconds it will be ready so the termcolor word will be no longer in red.
Click on the **install package termcolor** option. The package start the installation. After some seconds it will be ready so the termcolor word will be no longer in red.
Now **run** the program. You will see a green message:
Now **run** the program. You will see a green message: