This content was proof-read by Grammarly. You can Try Grammary for FREE
This Python program shows you how you can use the conditional if else statement in Python to find the largest among three numbers and display the result.
How to Find the Largest Value among three numbers in Python?
# Author : Abandantcode.com # Python Program to Find the Largest Value Among Three Numbers number1 = 1 number2 = 65 number3 = 3 if (number1 >= number2) and (number1 >= number3): largestNumber = number1 elif (number2 >= number1) and (number2 >= number3): largestNumber = number2 else: largestNumber = number3 print("The largest number among 3 Numbers is ", largestNumber)
Are you a .NET Developer planning to integrate GraphQL for .NET in your Application? Check out this book
The largest number among 3 Numbers is 65.
In the above python program, the input numbers are stored in the variables number1,number2,number3 respectively. The conditional if statements are used to check which one among the three numbers is largest.