Write a function to change a picture to grayscale and then negate it.
Note: All one has to do is combine the grayscale and negate methods
```
def grayscale(picture):
for p in getPixels(picture):
intensity = (getRed(p)+getGreen(p)+getBlue(p))/3 setColor(p,makeColor(intensity ,intensity ,intensity)) for px in getPixels(picture):
red=getRed(px)
green=getGreen(px)
blue=getBlue(px)
negColor=makeColor(255-red, 255-green, 255-blue) setColor(px,negColor)
```
OR (more simply)
```
def grayscale(picture):
for p in getPixels(picture):
intensity = (getRed(p)+getGreen(p)+getBlue(p))/3
intensity = 255-intensity
setColor(p,makeColor(intensity ,intensity ,intensity))
```
You might also like to view...
Excel's AVERAGE function returns mean of a set of numbers
Indicate whether the statement is true or false
The CISO wants to implement a Security Operations Center (SOC) to improve and coordinate the detection of unauthorized access to the enterprise. The CISO's biggest concern is the increased number of attacks that the current infrastructure cannot detect. Which of the following would NOT be a part of the solution in the SOC to address his specific concerns?
A. DLP B. white box testing C. NIPS D. forensics