from scipy import stats
import matplotlib.pyplot as plt
import numpy as np
import math
def RANGE(data):
    range = max(data.values()) - min(data.values())
    print(f"SADUSTATISTICS' RANGE RESULT: {range}")


def VARIANCE(data, mean):
    print(f"SADUSTATISTICS' VARIANCE RESULT: {sum((x - mean) ** 2 for x in data.values()) / len(data.items())}")


def StandardDeviation(data, mean):
    print(f"SADUSTATISTICS' STANDARD DEVIATION RESULT: {math.sqrt(sum((x - mean) ** 2 for x in data.values()) / len(data.items()))}")


def InterQuartile(data):
    sorted_data = sorted(data.values())
    q1 = sorted_data[1 * len(sorted_data) // 4]
    q3 = sorted_data[3 * len(sorted_data) // 4]
    print(f"SADUSTATISTICS' RESULT: {q3- q1}")
