Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

I don't know what is wrong with my code.

Seems like something small is missing with my code. I don't think it's a spacing issue as well.

morse.py
class Letter:
    def __init__(self, pattern=None):
        self.pattern = pattern
    def __str__(self):
        output = []
        for x in self.pattern:
            if x == '.':
                output.append('dot')
            elif x == '_':
                output.append('dash')
        return '-'.join(output)



    def __init__(self):
        pattern = ['.', '.', '.']
        super().__init__(pattern)

2 Answers

You have two __init__() for one class. Is the second one missing a class definition?

Vianney Gall
Vianney Gall
5,342 Points

I guess that what ursaminor is trying to say is that you miss this line above your last def init(self):

class S(Letter):

You might erased it by mistake because the code challenge already comes with this line.