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

Sarah Schaeffer
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Sarah Schaeffer
Data Analysis Techdegree Graduate 11,564 Points

Write Better Python Code Challenge Task 1 of 1

Getting a Bummer! saying whitespace on line 11. Thanks for any help and advice

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

2 Answers

Travis Alstrand
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Travis Alstrand
Data Analysis Techdegree Graduate 45,984 Points

Hey Sarah Schaeffer ! :wave:

Be sure that there are no invisible "spaces" on these lines. If you click on them and the cursor is "tabbed" over to the right, be sure to delete any of those sneaky spaces. Everything else about your code looks great!! Nice! :thumbsup:

Travis Alstrand
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Travis Alstrand
Data Analysis Techdegree Graduate 45,984 Points

You're welcome! Yes, all of that PEP8 stuff can be extremely particular and hard to catch at first. Luckily, we can set up our own Text Editors to automatically format to this for us so we don't usually need to worry about it much :smiley: