def get_average(pixels):
    """
    Given a list of pixels, finds the average red, blue, and green values

    Input:
        pixels (List[Pixel]): list of pixels to be averaged
    Returns:
        rgb (List[int]): list of average red, green, blue values across pixels respectively

    Assumes you are returning in the order: [red, green, blue]

    """
    # Variables to derive the average of different pixel color values
    red_sum = 0
    green_sum = 0
    blue_sum = 0
    red_num = 0
    green_num = 0
    blue_num = 0

    # Loop through each pixel in the list
    for pixel in pixels:
        if pixel.red > 0:                                                   # add up the value and the number
            red_sum += pixel.red
            red_num += 1
        if pixel.green > 0:
            green_sum += pixel.green
            green_num += 1
        if pixel.blue > 0:
            blue_sum += pixel.blue
            blue_num += 1

    # Compute the average for each color value
    if red_num == 0:                                                        # check whether none of pixels has the color
        red_avg = 0
    else:                                                                   # if not, divide the sum with the number
        red_avg = red_sum/red_num
    if green_num == 0:
        green_avg = 0
    else:
        green_avg = green_sum/green_num
    if blue_num == 0:
        blue_avg = 0
    else:
        blue_avg = blue_sum/blue_num

    # Return the list of average color values
    rgb = [red_avg, green_avg, blue_avg]
    return rgb