Learn
Interquartile Range
Quartiles

The interquartile range is the difference between the third quartile (Q3) and the first quartile (Q1). If you need a refresher on quartiles, you can take a look at our lesson.

For now, all you need to know is that the first quartile is the value that separates the first 25% of the data from the remaining 75%.

The third quartile is the opposite — it separates the first 75% of the data from the remaining 25%.

The interquartile range is the difference between these two values.

### Instructions

1.

We’ve calculated the first quartile of `songs` and stored it in the variable `q1`.

Calculate the third quartile and store it in a variable named `q3`.

To calculate the third quartile, call the same function, but change the second parameter to `0.75`.

2.

Now that we have both the first quartile and the third quartile, let’s calculate the IQR.

Create a variable named `interquartile_range` and set it equal to the difference between `q3` and `q1`.
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}