Welcome to the Treehouse Community
Looking to learn something new?
I want the class pattern to be the reverse of the pattern that was passed in
I want the class pattern to be the reverse of the pattern that was passed in. But not sure how to proceed
class Letter: def __init__(self, pattern=None): self.pattern = pattern def __iter__(self): yield from self.pattern def __str__(self): output =  for blip in self: if blip == '.': output.append('dot') else: output.append('dash') return '-'.join(output) @classmethod def from_string(cls, pattern): cls.pattern = pattern.reverse() return cls class S(Letter): def __init__(self): pattern = ['.', '.', '.'] super().__init__(pattern)