第 9 步:我们需要在 for 循环中使用 if 语句来测试用户是否猜对了数字!

  • 并拖出If 。将其放在for循环中。
  • 将测试变量从choice更改为guess
  • 拖出Say并将其放入if语句中。

.say()会有紫色黄色的缩进········因为它在一个循环一个 if 语句中!

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)