Order of Operations


#1




bool_four is equal to the result of -(1**2) < 2**0 and 10 % 10 <= 20 - 10 * 2

so I answered bool_four = True and False
following order of operations, 10 * 2 = 20, 20 - 20 = 0. and 10 % 10 = 1.
1 <= 0 is False
I received an error message, to check my bool_four response.
I changed this answer to True and it was marked as correct.

Isn't % divide? Do you just solve the problem in the order it's presented instead of following order of operations? Because that would make the statement True.


bool_four = True and False


#2

% is not the division operator, / is the division operator.

% calculates the remainder.


#3

Ohhhh, right. So when it says 108 % 100, then what's the answer? Is it 8? I don't completely understand the %


#4

well, you got it right. the remainder is indeed 8, so you seem to understand it fine.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.