def calculate_lost(tx, rx):
    """
    Returns frame lost percentage.

    :param tx: number of frame send
    :param rx: number of frame received
    :return: percentage of lost.
    """
    if rx == 0 or tx == 0:
        return 100

    frame_lost = abs((tx - rx) / rx * 100)
    return frame_lost