Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
Joseph Wasden
Joseph Wasden
20,403 Points

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
208,478 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
208,478 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
208,478 Points

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