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 Write Better Python Cleaner Code Function and Class Whitespace

So frustrated!!!! *ARG

ef first_function(arg1): return 'arg1 is {}'.format(arg1)

def second_function(arg1): return 'arg1 is {}'.format(arg1)

class MyClass:

args = [1, 2, 3]

def class_func(self):
    return self.args

Add Comment Still stuck. You all must think I'm a fool by now!

starter.py
def first_function(arg1):
    return 'arg1 is {}'.format(arg1)


def second_function(arg1):
    return 'arg1 is {}'.format(arg1)


class MyClass:

    args = [1, 2, 3]

    def class_func(self):
        return self.args

In the code challenge, I would double check that your empty lines truly are empty; they may have been auto tab intented, so they were not considered empty. Something to check and try.

Also, asking questions is always a good sign; in fact, as you progress, you'll find you get better and better at asking questions. It may not feel like it, and it can be very frustrating, but just know that needing to ask questions is a normal and expected part of the learning process, and coding is, at it's heart, a path of constant learning.

imposter syndrome is real. It's a constant danger to feel like you just aren't good enough, or don't know enough. Just be kind, be humble, and be curious, and you'll be on the right track. we all need to start somewhere. Try and focus on the small victories you make each day.

One age-old trick that some programmers use Rubber duck debugging. If a programmer ran into some difficult code, they would explain, line by line, the code in question to a rubber duck. Sometimes, just needing to explain it to someone -- or something -- can help identify where in the code we are stuck or confused, and then we can focus our energy there, or ask someone for help.

4 Answers

Steven Parker
Steven Parker
231,198 Points

Did you get this message? "Bummer: Your file has 1 error(s) on line(s) 14: no newline at end of file." That's letting you know that it expects a blank line at the end.

Otherwise, it seems to pass as is.

The last few challenges I was able to zap without much ado.....ty for your support!

Steven Parker, I want to ask you something. I'm doing Treehouse for a course I'm taking. Right now, it's free but I'm looking to purchase a subscription so I can keep learning. Is that possible?

Steven Parker
Steven Parker
231,198 Points

I never did the free trial myself, but check your Account page, it probably has a "subscribe" button or link on it. if you don't find what you need there, try contacting the Support staff for assistance.

You know, I've been thinking its not me...daggone stupid Python interpreter...smh...

Steven Parker
Steven Parker
231,198 Points

Lynn Collins — If your original question has been answered, you can mark the question solved by choosing a "best answer". And happy coding!