Images can be described as 3D lists.
# This image has only one white pixel:
[
[[255, 255, 255]]
]
# This one is a 2 by 2 black image:
[
[[0, 0, 0], [0, 0, 0]],
[[0, 0, 0], [0, 0, 0]]
]
Your task is to create a function that takes a 3D list representation of an image and returns the grayscale version of that.
grayscale([
[[0, 0, 0], [0, 0, 157]],
[[1, 100, 0], [0, 10, 0]]
]) ➞ [
[[0, 0, 0], [52, 52, 52]],
[[34, 34, 34], [3, 3, 3]]
]