Odd Or Even Number In Python

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