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 Operator Spacing

Mubarig CISMAN
seal-mask
.a{fill-rule:evenodd;}techdegree
Mubarig CISMAN
Python Web Development Techdegree Student 2,547 Points

Bummer! Don't change the code, just fix the whitespace

I am on this for an hour or so . Every thing seems to be OK, but I am still getting this must be bug or some thing else. I have even checked with http://pep8online.com/ and it passed. Any ideas ?

starter.py
numbers = [1, 2, 3, 4, 5]


def add(num1, num2):
    return num1 + num2


def subtract(num1, num2):
    return num1 + num2


def mathy(num1, num2):
    up = add(5 + 7, 7 + 9)
    down = subtract(6, 3)
    return add(up, down)

2 Answers

akhter ali
akhter ali
15,778 Points

Looks like you're changing the code. The original code had

def mathy(num1, num2):
    up = add(5 + 7, 7 + 9)
    down = subtract(6,3)
    return add(up,down)

You changed the up variable in that function to

up = add(9 + 5, 7 + 4)
Mubarig CISMAN
seal-mask
.a{fill-rule:evenodd;}techdegree
Mubarig CISMAN
Python Web Development Techdegree Student 2,547 Points

I think that is not the case. I have changed that numbers to its original ones. But still getting the same error. I don't know where this comes from. I think I have to report to the support team.

akhter ali
akhter ali
15,778 Points

Are you sure? Because this just passed

numbers = [1, 2, 3, 4, 5]


def add(num1, num2):
    return num1 + num2


def subtract(num1, num2):
    return num1 - num2


def mathy(num1, num2):
    up = add(5 + 7, 7 + 9)
    down = subtract(6, 3)
    return add(up, down)

Don't forget the empty newline at the bottom.

Mubarig CISMAN
seal-mask
.a{fill-rule:evenodd;}techdegree
Mubarig CISMAN
Python Web Development Techdegree Student 2,547 Points

Some thing is not right with the System of Treehouse, they may have a bug in it. I have deleted all Cookies, browser history and etc , restarted the challenge and submitted exactly the same Code and it passed like a fly. It is not the first time this happened to me. Thanks for the Answers akhter ali

akhter ali
akhter ali
15,778 Points

Try a different browser. Also don't forget the empty new line at the bottom.