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

PHPMotion implementation - URL based videos (Hosted on separate location) -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -