STEP 13: Since the diameter of the circle is changing, we must recalculate the area every time we move the mouse.

  • In the LOGIC tab, click on and drag out Float Variable inside the move_mouse block.
  • Change the name of the variable from my_var to circle_area.
  • Change the value of circle_area from 2.34 to this equation: 3.14 * (x/2) ** 2

We are using (x/2) as our radius, since we set our diameter to be equal to x!

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)