WARNING: This program has an error! We are trying to change "black" to "blue" in the rainbow list. Let's debug it!

RULE: .index() returns the index of a value in a list.

  • Click Run and read the error message.
  • Change what's in the parentheses of .index() to get the index of the color we want to change.
  • Click Run to see if you fixed the program. When it is fixed, click Submit and Next.

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
  • 提交作品
  • 下个活动
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)