1# Python program to find the largest number among the three input numbers
2# take three numbers from user
3num1 = float(input("Enter first number: "))
4num2 = float(input("Enter second number: "))
5num3 = float(input("Enter third number: "))
6
7if (num1 > num2) and (num1 > num3):
8 largest = num1
9elif (num2 > num1) and (num2 > num3):
10 largest = num2
11else:
12 largest = num3
13
14print("The largest number is",largest)
15
1a=int(input())
2b=int(input())
3c=int(input())
4#((a>b)?(a>c?a:c):(b>c?b:c))
5if(a>b):
6 if(a>c):
7 print("a")
8 else:
9 print("c")
10else:
11 if(b>c):
12 print("b")
13 else:
14 print("c")
1Method 1 : Sort the list in ascending order and print the last element in the list.
2
3filter_none
4edit
5play_arrow
6
7brightness_4
8# Python program to find largest
9# number in a list
10
11# list of numbers
12list1 = [10, 20, 4, 45, 99]
13
14# sorting the list
15list1.sort()
16
17# printing the last element
18print("Largest element is:", list1[-1])
19Output:
20
21Largest element is: 99