White A. answered 03/08/23
experienced csa tutor
The input is not very clear in this problem. Is the shape of input [h, w, 2]?
I write a simple solution.
Panhary H.
asked 03/07/23Problem C. Mirror
Next, you will be implementing the mirror function. This overwrites the right half of the image with a mirror image of the left (so within each list of lists representing a row of pixels, the pixels in the second half of the row are overwritten by a mirror image of the pixels in the first half). If there are an odd number of columns, the middle column remains unchanged.
Examples:
>>> mirror([[[127, 127, 127], [0, 0, 0]],
[[255, 255, 0], [50, 128, 255]],
[[0, 0, 255], [0, 255, 0]],
[[255, 0, 0], [255, 255, 255]]])
[[[127, 127, 127], [127, 127, 127]],
[[255, 255, 0], [255, 255, 0]],
[[0, 0, 255], [0, 0, 255]],
[[255, 0, 0], [255, 0, 0]]]
White A. answered 03/08/23
experienced csa tutor
The input is not very clear in this problem. Is the shape of input [h, w, 2]?
I write a simple solution.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.