Function, biggest of three numbers

# Function - biggest of three numbers

def fn_big(x,y,z):
    if (x >= y and x >= z):
        return x
    elif (y >= x and y >= z):
        return y
    else:
        return z
    return max(x,y,z)

num1 = int(input("Enter number :"))
num2 = int(input("Enter number :"))
num3 = int(input("Enter number :"))

big = fn_big(num1, num2, num3)
print("biggest of three numbers is :", big)

# Function - biggest of three numbers

def fn_big(x,y,z):
    return max(x,y,z)

num1 = int(input("Enter number :"))
num2 = int(input("Enter number :"))
num3 = int(input("Enter number :"))

big = fn_big(num1, num2, num3)
print("biggest of three numbers is :", big)

No comments:

Post a Comment

Don't be a silent reader...
Leave your comments...

Anu