Python Write Better Python Cleaner Code Function and Class Whitespace

FHATUWANI Dondry MUVHANGO
FHATUWANI Dondry MUVHANGO
17,796 Points

problems with starter.py

i know its a simple task, but way too frustrated because i cant get the space correct. i believe my spacing is right, but it keeps giving me errors that i cant even find

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

3 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! You're right. There are invisible characters that are giving the errors. It's counting the indentation as whitespace on lines that otherwise contain nothing else. This has to do with the way things auto-indent on a new line. And because you're so close here, I'm just going to give this hint. Put your cursor in the lines you believe are blank. I can almost guarantee you it won't be flush with the left side. Backspace to remove the additional whitespace that was added, and recheck the code. Pay close attention to the "Bummer!" messages as they are absolutely crucial to passing this challenge.

I hope this helps, but let me know if you're still stuck! :sparkles:

FHATUWANI Dondry MUVHANGO
FHATUWANI Dondry MUVHANGO
17,796 Points

Ok. I've tried your method I'm left with only one on line 13, that i definetly dont know how to fix. It keeps saying " no new line at the end of the file"

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Then you're at the end! Simply add a new line after the last line that you've typed. Be careful though, it might try to auto-indent so make sure you take out any of those pesky spaces that might have popped up so that the cursor is flush with the left side :thumbsup: