STEP 9: Let's use the value of y (the y-coordinate of the mouse) to set the height of the rectangle.

  • Click on and drag out Set Height. Drop it inside the mouse_move block.
  • Change the name before .set_height() to my_rect.
  • Change the argument in .set_height() to y.

We are setting my_rect's height equal to the mouse's y-coordinate!

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)