Computer >> Máy Tính >  >> Lập trình >> Python

Chương trình Python tối đa là ba.

Cho ba số a b và c, nhiệm vụ của chúng ta là chúng ta phải tìm phần tử lớn nhất trong số đã cho.

Ví dụ

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

Thuật toán

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.

Mã mẫu

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)) 

Đầu ra

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