Write a function that takes three numbers as parameters, and returns the median value of those parameters as its result. Include a main program that reads three values from the user and displays their median.
Hint: The median value is the middle of the three values when they are sorted into ascending order. It can be found using if statements, or with a little bit of mathematical creativity
Refer sample input and output for formatting specification.
def median(a,b,c): d=[a,b,c] d.sort() print(d[1]) a=int(input()) b=int(input()) c=int(input()) median(a,b,c)
Input_1:
5
2
10
Output:
5
Input_2:
50
10
100
Output:
50
Morae Q!
- Convert Numbers into Roman Numerals
- Return the size of the longest sub-string
- Return all strings in words which is sub-string of another word in any order.
- Calculate the step by step sum of startValue plus elements in array.
- Find the minimum number of Fibonacci numbers whose sum is equal to k.
- Given a string s of zeros and ones, return the maximum score after splitting the string.
- Write a efficient functions to find floor of x.
- Print all numbers less than n which are having digits only 3 or 7 or both.
- Function that returns true if given array can be divided into pairs.
- Find the smallest element in the list that is larger than the given target.
- Print the First N prime numbers.
- The Chef’s Binary Tree.
- The minimum number of strikes he will have to make.(so that all his enemies have the same name)
- Sum of Natural Numbers.
- Sum of the Input.
- Find the Sum of the Series: 1 + 1/2 + 1/3 + .. + 1/N.
- Split elements into even and odd list
- Python Program to Merge Two Lists and Sort it.
- Median of Three.
- Find the Largest Number in a List.