Python Program to find largest among three numbers
Python Program to find largest among three numbers
In this, we discuss how to write a Python program to find the largest of the three input numbers. To understand the following program, you must have the knowledge to follow Python concepts:
Python Program to find largest among three input numbers entered by user
In the next Python application, we take input from the user. The user enters three numbers and the system obtains the largest of the three numbers using the if..elif..else statement. Here we use the float () function by taking input from user
Let's take a look how to write a Python Program to find largest among three numbers.
Python code:
x = float(input('enter value of x:'))
y = float(input('enter value of y:'))
z = float(input('enter value of z:'))
if (x>y and x>z):
print('x is greatest')
print(x)
elif(y>z and y>x):
print('y is greatest')
print(y)
else:
print('z is greatest')
print(z)
Output:
enter value of x: 79
enter value of y: 45
enter value of z: 56
x is greatest
79.0
Recommended Post:Program to check whether the number is prime
Plotting of even, odd, prime numbers
Subplot of even, odd and prime numbers from a list
Python Program to print Arithmetic Progress series
Program to find even and odd numbers from the list
Program to check whether a number is odd or even in Python