Python % Percent -


i wondering if can me understand following python calculation answer calculates 97:

100 - 25 * 3 % 4 

i understand % sign in python represents remaining of amount, however, i'm still not seeing how answer comes out 97. if break calculation down understand grateful.. thanks!

it's evaluated in order python:

explanation of sum

* , % take precedence on -, first evaluate 25 * 3 % 4. * , % have same priority , associativity left right, evaluate left right, starting 25 * 3. yields 75. evaluate 75 % 4, yielding 3. finally, 100 - 3 97.


Comments

Popular posts from this blog

What can cause "Required Package 'IndyCore' not found" when compiling a Delphi 2010 project? -

Change the color of an oval at click in Java AWT -