I have searched but it looks like this is almost too basic to have been posted prior to this. I am starting to learn Python and I have been given an example to write. One thing I don't understand about it is how the % works in this specific example below:
print 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6
I have used basic order of operations to break it down a little bit
(3 + 2 + 1 - 5) + (4 % 2) - (1 / 4) + 6
1 + (4 % 2) - .25 + 6
1 + (4 % 2) - 6.25
Where I am stuck at is how (4 % 2) works. Reading the example further on the final result is 7 but I am not seeing how it comes to this. I think the issue is how I am reading it in my head. Any help would be greatly appreciated.