Hello, i know how to use modulus but i dont understand what a part of this code means:
a % 2 == 0
what does 2 == 0 means? why is there a zero over there? and why is there a == there?
Thanks!
It checks if the remainder returned by a%2 is equal to 0. In particular this identifies even numbers.
Dont exactly understand, can you give me an example? thanks!
'==' checks if the things on either side of it are equal. If they are it returns true, else it returns false.