Skip to content
DeepForgeby svx
All problems
MediumStatisticsst-325

Coefficient of Quartile Variation

Problem

The coefficient of quartile variation is 100 * (Q3 - Q1) / (Q3 + Q1).

Given the first and third quartiles, return the coefficient.

Hint

It measures spread relative to the interquartile center.

Test cases

case 1
in: [1,3]
expected: 50
case 2
in: [10,20]
expected: 33.333333333333336
case 3
in: [0,5]
expected: 100
Starter codePython
def coefficient_of_quartile_variation(q1, q3):
    # Your code here
    pass

3 test cases · run your code against them in the editor