Python Forum

Full Version: Even number code syntax error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have just began my python journey
I am trying to write a code to check if vaue x y z are even numbers
This is my code
if x %2 == 0: or y %2 == 0: or z %2 == 0:
    print("This is an even number")
There is a syntax error and I don't know how to correct it.

I don't even know what it's doing but I understand (via textbook) that %2 ==0 checks if there is a remainder left and if so, then its not an even number.
eliminate all ':'
in addition, you need to use a simple algorithm rather than conditional statements.

x % 2 == 0 --> even