Answered step by step
Verified Expert Solution
Question
1 Approved Answer
app.stepsPerSecond = 5 app.reds = [ 2 5 5 , 2 2 0 , 2 0 0 , 1 5 0 , 1 2 5
app.stepsPerSecond
app.reds
app.y
Rect
def drawRowOfRectangles:
x
# Draws a rectangle for each red value.
for red in app.reds:
Rectx app.y fillrgbred
x
def onMousePressmouseX mouseY:
drawRowOfRectangles
# Remove the last value from the app.reds list and store it in newVal.
### Fix Your Code Here ###
newVal
# 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
##### Place your code above this line, code below is for testing purposes #####
# test case:
onMousePress
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started