python even or odd

num = int(input("Enter a number: "))  
if (num % 2) == 0:  
   print("{0} is Even number".format(num))  
else:  
   print("{0} is Odd number".format(num))  

Here is what the above code is Doing:
1. We take input from the user and store it in the num variable.
2. We use the if statement to check if the number is divisible by 2 or not.
3. If the number is divisible by 2, it means it is an even number.
4. If the number is not divisible by 2, it means it is an odd number.
5. We print the appropriate message depending on the condition.