Python Code Challenges: Control Flow (Advanced) Challenge 3 error in answers for Codecademy to update

Python Code Challenges: Control Flow (Advanced)

Challenge Three answer is incorrect:

The solution provided for the challenge 3 uses >0 or <0 which is incorrect on the first test below is false as the first test is as the number is 0 which is netiher > or <

#print(always_false(0)) which provides None as answer and not false
if (num > 0 and num < 0):
return True
return False

This provide output as none

I had user #if num >=0 or <= 0: which provides the desired false for this output!!

To preserve code formatting in forum posts, see: [How to] Format code in posts

Can you post your properly formatted code?

What output does your code produce? What output does the solution code produce? Why do you think the solution is wrong?

Thankyou, after reviewing again both work EXCEPT the provided answer is much better and will always work. I also read into how to format code and will take on board :grinning: :pray:

1 Like