Skip to content
C

Problem 3: Remove Outliers from a Dataset

Easypython

Problem Description

Write a Python program that removes outliers from a list of numbers using the IQR method, and prints the cleaned list along with the count of removed values.

Input

A list of numbers.

Output

The cleaned list (without outliers) and the count of removed outliers.

Constraints

  • The list will contain at least 5 numbers.

Example Input

text
[20, 22, 21, 23, 22, 150]

Example Output

text
Cleaned data: [20, 22, 21, 23, 22] Outliers removed: 1

Concepts Covered

IQR method, filtering, list/array manipulation.

Input (stdin)

Output

Run your code to see output here...