In this program, You will learn how to find the largest of two numbers using function in Python.
def largest(x, y):
if x > y:
return True
else:
return False
def largest(x, y):
if x > y:
return x
else:
return y
x = int(input("Enter first number:"))
y = int(input("Enter second number:"))
result = largest(x, y)
print("Largest is:", result)
Enter first number:10
Enter second number:8
Largest is: 10