Python program maximum of three.


Given three number a b and c, our task is that we have to find the maximum element in among in given number.

Example

Input: a = 2, b = 4, c = 3
Output: 4 

Algorithm

Step 1: input three user input number.
Step2: Add three numbers to list.
Step 3: Using max() function to find the greatest number max(lst).
Step 4:  And finally we will print maximum number.

Example Code

def maximum(a, b, c): 
   list = [a, b, c] 
   return max(list) 
# Driven code  
x = int(input("Enter First number"))
y = int(input("Enter Second number"))
z = int(input("Enter Third number"))
print("Maximum Number is ::>",maximum(x, y, z)) 

Output

Enter First number 56
Enter Second number 90
Enter Third number 67
Maximum Number Is ::> 90

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 30-Jul-2019

9K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements