Python classes - Inheritance
In the previous post we saw how to create python classes and methods under them. We create a DNA class representing a DNA sequence. However, we can treat a DNA sequence as a string. A special kind of string that consists of only four letters, namely, ‘A’, ‘T’, ‘G’, and ‘C’ representing the nucleotides adenine, thiamine, guanine and cytosine, respectively. The DNA sequence should not contain any other characters. For ease of use we will allow entry of small and capital case letters which would be converted to capital case letter inside the class definition. Here we will create a class that is inherits properties from the built-in str class. class subclass(parent_class): # class definition To do so we just have to put the parent class in brackets while defining our current class. We can create as many subclasses that are themselves inherited from other subclasses in this way. class subclass(parent_class): # class definition class subclass_2(subclass): # class def...