how to check which number is higher in python

Solutions on MaxInterview for how to check which number is higher in python by the best coders in the world

showing results for - "how to check which number is higher in python"
Luce
07 Sep 2020
1# Python program to find the largest number among the three input numbers
2
3# change the values of num1, num2 and num3
4# for a different result
5num1 = 10
6num2 = 14
7num3 = 12
8
9# uncomment following lines to take three numbers from user
10#num1 = float(input("Enter first number: "))
11#num2 = float(input("Enter second number: "))
12#num3 = float(input("Enter third number: "))
13
14if (num1 >= num2) and (num1 >= num3):
15   largest = num1
16elif (num2 >= num1) and (num2 >= num3):
17   largest = num2
18else:
19   largest = num3
20
21print("The largest number is", largest)