Step 1: This program has 3 different functions. Let's refactor it to use one function, with two parameters!

  • Create a new function at the top of the program, and name it fly().
  • Add two parameters in the parentheses after fly(): fly_type so the toucan can say how high he's flying, and fly_height to control how high the toucan flies!
  • Have the toucan sprite say "I flew " + fly_type in the function.

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)