The function copyHalf copied the top half of the picture into the bottom half. Write a new function copyUpHalf that copies the bottom half of the picture into the top.

What will be an ideal response?


```
def copyUpHalf(picture):
pixels = getPixels(picture)
for index in range(0,len(pixels)/2):
pixel1 = pixels[index + len(pixels)/2]
color1 = getColor(pixel1)
pixel2 = pixels[index]
setColor(pixel2 ,color1)
```

Computer Science & Information Technology

You might also like to view...

Which of the following statements regarding the use of counterfeit parts is accurate?

A. Counterfeit parts do not affect the security of a product B. Counterfeit parts do not function the same way as authentic parts C. Counterfeit parts reduce costs and improve product stability D. Counterfeit parts can be used to provide a feature that the original manufacturer cannot provide

Computer Science & Information Technology

The Applications menu in CentOS 7 which allows access to most of the installed applications is located on which bar within the GUI?

A. bottom bar B. left side bar C. right side bar D. top bar

Computer Science & Information Technology

Running the Disk Defragmenter utility will ________

A) mark bad memory cells B) clean out your Startup folder C) detect and remove spyware D) make the hard drive work more efficiently

Computer Science & Information Technology

Consider the following definition of the recursive function mystery.int mystery(int num){  if (num

A. 50 B. 65 C. 120 D. 180

Computer Science & Information Technology