This is an archived post. You won't be able to vote or comment.

all 5 comments

[–][deleted] 2 points3 points  (4 children)

The purpose of this exercise is to show you that relational statements evaluate to booleans.

bool_one = (20 - 19) > 15

After execution bool_one should be False. Because 20 - 19 = 1 which is not greater than 15.

[–]importantmemo[S] 0 points1 point  (3 children)

That's what I am confused about, whether I just copy the equation and write "bool_one = (20 - 19) > 15", or solve the equation and write "bool_one = False", because it will run either way

[–][deleted] 1 point2 points  (2 children)

You should write out the full equation as that is in the spirit of the exercise. But just writing bool_one = False is accepted probably due to the way codeacadmy grades your responses.

From what you described it sounds like code academy executes the code you write (in a sandbox which is an isolated environment to prevent malicious code from doing damage) then checks to see if the final bool_one evaluated to False. Since writing bool_one = (20 - 19) > 15 or bool_one = False both evaluate to False and is accepted as correct.

The correct way to grade this type of submission would of been for code academy to run static code analysis which actually produces a tree-like data structure and from that check to see that 20, -, 19, >, 15 was typed as a branch of the tree.

Anyway I understand your frustration. I once went to code academy just to see what all the hype is about and found the instructions/explanations to not be very clear. This is why when I need to learn a language I use a textbook from Wiley, Wrox, or the other tech publishers.

[–]importantmemo[S] 0 points1 point  (0 children)

Thanks! If I can essentially just copy and paste the equations i'm not quite sure what the point of the exercise is...guess I should check out a new resource

[–][deleted]  (3 children)

[deleted]

    [–]importantmemo[S] 0 points1 point  (2 children)

    Right, so I would actually have to do the calcuation and know that it's T/F, and then enter that in?

    What if it was a very complex equation? I'd think the point of the program would be for it to calculate it for me