Friday, January 27, 2017

Greater of three Number in Python

Tags


Functions are defined in python using def keyword .Following will illustrate the concept.

Code::

def max(a,b,c):
    if(a>b and a>c):
        print ("Greater is :",a)
    elif(b>c and b>a):
        print("Greater is : ",b)
    else:
        print("Greater is :",c)
        
     
a=input("Enter First No:")
b=input("Enter Second no.:")
c=input("Enter Third no:")

max(a,b,c)


Output: