Answers for "write a program to find the greatest of three numbers in python"

2

program to find the largest of three numbers in python

# Python program to find the largest number among the three input numbers
# take three numbers from user
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
num3 = float(input("Enter third number: "))

if (num1 > num2) and (num1 > num3):
   largest = num1
elif (num2 > num1) and (num2 > num3):
   largest = num2
else:
   largest = num3

print("The largest number is",largest)
Posted by: Guest on July-24-2020
0

greatest of three numbers in python

a=int(input())
b=int(input())
c=int(input())
#((a>b)?(a>c?a:c):(b>c?b:c))
if(a>b):
    if(a>c):
        print("a")
    else:
        print("c")
else:
    if(b>c):
        print("b")
    else:
        print("c")
Posted by: Guest on March-04-2021

Code answers related to "write a program to find the greatest of three numbers in python"

Python Answers by Framework

Browse Popular Code Answers by Language