Write a function to mirror the input picture’s leftmost 20 pixels to pixels 20 to 40.

What will be an ideal response?

```
def copyOverTwenty (src):
w = getWidth(src)
h = getHeight(src)
for x in range(0, 20):
for y in range(0,h):
p = getPixel(src, 40-x, y)
p2 = getPixel(src, x, y)
color = getColor(p2)
setColor(p, color)
```

Note: This question is very similar to many we have done before, the key is which pixels it writes to and from. In particular, the range for the first for loop and the line “p = getPixel(src, 40-i, j)”.

Computer Science & Information Technology

You might also like to view...

Tasks appear on the ________ List in the main window of the Tasks component

A) Notes B) Contacts C) Schedule D) To_Do

Computer Science & Information Technology

What is the purpose of adding an input mask to a field?

What will be an ideal response?

Computer Science & Information Technology