To check a given number is even or odd in Python

 n=int(input("Enter a number"))

if(n%2==0):

    print("{0} is even".format(n))

else:

    print("{0} is odd".format(n))


Comments

Popular posts from this blog

Data Science Matplotlib Library Data Visualization, ASSIGNMENT - 6, GO_STP_8113