Problem Description
Create a program that reads three integers from the user and displays them in sorted order (from smallest to largest).
Use the min and max functions to find the smallest and largest values.
The middle value can be found by computing the sum of all three values, and then subtracting the minimum value and the maximum value.CODING ARENA
a=[]
for i in range(3):
b=int(input())
a.append(b)
a.sort()
print("The minimum value is",a[0])
print("The maximum value is",a[2])
print("The middle value is",a[1])
Test Case 1
Input (stdin)25
12
1988Expected OutputThe minimum value is 12
The maximum value is 1988
The middle value is 25Test Case 2
Input (stdin)9
19
1972Expected OutputThe minimum value is 9
The maximum value is 1972
The middle value is 19
✖
Share this Posts
Subscribe Our Newsletter
0 Comment
Post a Comment