FAQ: Operators - Putting it All Together

I belive i’ve entered the correct code but no orange ap(pear) :smile:

orange = 4
orange = orange - 2

Now, is this below also a correct solution ?

orange = 4
orange = orange / 2

Nevertheless the number of apples displayed is correct.

Not really. We are told to subtract (take away) 2 from the number of oranges. It is only coincidental that 4 - 2 happens to be the same as 4 / 2. What happens if we have 6 oranges? Subtract 2 and we have 4; divide by 2 and we get 3.

Division and subtraction are not interchangeable operators any more than addition and multiplication are.

Thank you for your help !

1 Like

It doesn’t work for me either, nothing comes out on the screen

Does anyone other than a bot checks to make sure the exercises work?

Each exercise has an accompanying program called a Submission Correctness Test (SCT). There is no test performed by a human if that is what you asking.