Question: what does x 2 mean in python?
Answer: x % 2 gives the remainder after the integer division (when dealing with only integers such as in this case, otherwise a common type) of x/2 . The % is called the modulo operator. Of course when the remainder is 0, the number is even. ... A zero right argument raises the ZeroDivisionError exception.