Given three number a b and c, the task is that we have to find the greatest element in among in given number
Input : a = 2, b = 4, c = 3 Output : 4 Input : a = 4, b = 2, c = 6 Output : 6
Method 1 (Simple)
Method 2 (Using List)
. Initialize three number by n1, n2 and n3
. Add three numbers into list lst = [n1, n2, n3].
. Using max() function to find the greatest number max(lst).
. And finally we will print maximum number
Method 3 (Using max function)
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.