def__iter__(self):# method that allows us to iterate over all symbols, e.g. "for sym in Alphabet('ACGT'): print sym" prints A, C, G and T on separate lines
def__iter__(self):# method that allows us to iterate over all symbols, e.g. "for sym in Alphabet('ACGT'): print sym" prints A, C, G and T on separate lines
tsyms=tuple(self.symbols)
tsyms=tuple(self.symbols)
returntsyms.__iter__()
returntsyms.__iter__()
def__getitem__(self,ndx):
""" Retrieve the symbol(s) at the specified index (or slice of indices) """
returnself.symbols[ndx]
defindex(self,sym):
""" Retrieve the index of the given symbol in the alphabet. """
returnself.symbols.index(sym)
def__str__(self):
returnself.symbols
""" Below we declare alphabet variables that are going to be available when
""" Below we declare alphabet variables that are going to be available when