USING INPUT: Now it's time to throw the ball using the integers the user has provided.

  • Click and drag Set x Speed and Set y Speed into the bottom of the code editor.
  • Change the integer argument in .set_x_speed() from 5 to the input variable x_speed.
  • Change the integer argument in .set_y_speed() from 5 to the input variable y_speed.
  • Run the code! Can you enter numbers that shoot the basketball and get it in the basket?

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)