Statistics Intermediate: Averages and Variability - The Weighted Mean and the Median Screen 4

Hello,

I would like to ask why the median for

distribution1 = [23, 24, 22, ‘20 years or lower,’, 23, 42, 35] is 23

After sorting this list we have the next result:

[22, 23, 23, 24, 35, 42, ‘20 years or lower,’]

the median is 24. Or I’m doing something wrong?

Screen Link: Statistics Intermediate: Averages and Variability - The Weighted Mean and the Median: Screen 4

Thanks

@roman.r.k.88
Don’t you think the sorted list should be like this:

[‘20 years or lower,’ 22, 23, 23, 24, 35, 42]
Because ‘20 years or lower’ is the smallest among all the elements in the list, you have to put it on the first position while you are sorting the list in ascending order.
And the median must be 23.
Please mark my answer as solution, if you’re satisfied with it.
Thanks.

Yes, you right! My mistake, in mixed list I alway putted str objects at the end of list.

Thanks

In fact, thank you so much.:slight_smile: