Question: In PYTHON 2. Please write a function my_median to get the median number of three. The function takes three numbers and return the median one.

In PYTHON

2. Please write a function my_median to get the median number of three. The function takes three numbers and return the median one. median is the number that is the middle one if the three numbers are sorted. For example, if a=4, b=1, c=3, the function should return 3 as 3 is the median one among three numbers.

More examples: my_median(1,2,3) = 2 my_median(100, 10, 102 ) = 100 my_median(1, 2, 2 ) = 2 def my_median ( a, b, c ):

3. Considering the following code snippet:

sum = 0 for i in range(10): if i % 2 == 0 : sum = sum + i print ( sum )

What is the output of the above code ?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!