Question: app.stepsPerSecond = 5 app.reds = [ 2 5 5 , 2 2 0 , 2 0 0 , 1 5 0 , 1 2 5

app.stepsPerSecond =5
app.reds =[255,220,200,150,125,100,90,75,50,10]
app.y =0
Rect(0,0,400,400)
def drawRowOfRectangles():
x =0
# Draws a rectangle for each red value.
for red in app.reds:
Rect(x, app.y,40,25, fill=rgb(red,0,0))
x +=40
def onMousePress(mouseX, mouseY):
drawRowOfRectangles()
# Remove the last value from the app.reds list and store it in newVal.
### Fix Your Code Here ###
newVal =0
# Creates a new list with the last value.
newList =[ newVal ]
# Add all of the other red values to the newList.
### (HINT: Loop over app.reds and add each element to newList.)
### Place Your Code Here ###
# Sets app.reds equal to the new list.
app.reds = newList
# Shifts where the next rectangle will be drawn.
app.y +=25
##### Place your code above this line, code below is for testing purposes #####
# test case:
onMousePress(200,200)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!