Webeduclick.com
Computer Science Tutorials
def evenodd(a): if(a%2==0): return 1 else: return -1 a=int(input("Enter the number:")) flag=evenodd(a) if(flag==1): print("Number is even") if(flag==-1): print("Number is odd")
Output: