Assuming output entries are integers in range [0; 255] and your initial tuple named image
:
from statistics import mean
gray_image = tuple(int(mean(pixel)) for pixel in image)
or more beginner friendly (and assuming pixels just default python integers, not uint8):
gray_image = [] # create empty list
for pixel in image:
R, G, B = pixel # get rgb values
gray_pixel = (R + G + B) // 3 # averaging to get gray
gray_image.append(gray_pixel)
gray_image = tuple(gray_image) # turn list to tuple
It's simple averaging, but if there is need to get more technical, please take a look at this answer.