Question: Program 34 (page 89) obviously reduces the red by too much. Write a version that only reduces the red by 10%, then one by 20%.

Program 34 (page 89) obviously reduces the red by too much. Write a version that only reduces the red by 10%, then one by 20%. Can you find pictures where each is most useful? Note that you can always repeatedly reduce the red in a picture but you don’t want to have to do it too many times.


Data from Problem 34

Reduce the Amount of Red in a Picture by 50%

def decreaseRed (picture): for pix in getPixels(picture): value=getRed (pix) setRed (pix, value*0.5)

def decreaseRed (picture): for pix in getPixels(picture): value=getRed (pix) setRed (pix, value*0.5)

Step by Step Solution

3.25 Rating (163 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

10 version def decreaseRedpicture for ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction to Computing and Programming in Pytho Questions!