第6步:让我们创建一个允许玩家多次猜测的循环。

我们将在程序中使用 for 循环range() 中的数字决定了循环重复的次数。

  • 点击 并拖出 Loop with Range
  • 将循环重复次数更改为 3
  • Say 中拖动到 for 循环内部,使其有一个 ····。 并将其分配给 computer

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)