第 6 步:是时候添加我们的第一个 if 语句了!我们要测试rand_answer的值是否等于1

  • 在逻辑中,单击并拖出if 。将其放在程序的底部。
  • 测试变量choice更改为rand_answer
  • 测试值从字符串"yes"更改为整数1

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)