Python Exercise: Find the median of three values
40. Median of Three Values
Write a Python program to find the median of three values.
Pictorial Presentation:

Sample Solution:
Python Code:
Sample Output:
Input first number: 25 Input second number: 55 Input third number: 65 The median is 55.0
Flowchart :

For more Practice: Solve these Related Problems:
- Write a Python program to calculate the median of three numbers using conditional statements.
- Write a Python program to sort three input numbers and return the middle element as the median.
- Write a Python program to compute the median of three numbers without using built-in sorting functions.
- Write a Python program to implement a function that returns the median of three given values using pairwise comparisons.
Go to:
Previous: Write a Python program to display the sign of the Chinese Zodiac for given year in which you were born.
Next: Write a Python program to get next day of a given date.
Python Code Editor:
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.