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 trialAer sdfsd
1,669 Pointsstarter.py
This code drive me nuts. How do i find the whitespace? Also the blank line at the end of the code does not work too. Either it is 0 1 or 2.
Your file has 5 error(s) on line(s) 10, 4, 13, 14: blank line contains whitespace; blank line at end of file; expected 2 blank lines, found 1.
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
Peter Lawless
24,404 PointsWalk through your code with your arrow keys and see if there are spaces at the end of each line (including blank lines). Good news, though: In a text editor you can install plugins that will check your Python code (flake8 is an example) and will bring PEP8 violations to your attention as you write code, so you won't have to do this manually when you're writing code for development.
Ankoor Bhagat
1,098 PointsBummer! Your file has 1 error(s) on line(s) 11: blank line contains whitespace.
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
Cheo R
37,150 PointsCheo R
37,150 PointsSome editors have an option to highlight white space/blank lines.