第8步:使用用户输入的信息来决定我们的程序下一步如何运行!

  • Python中,点击 ,拖出 if。 拖出的代码行就是测试语句
  • == 左侧的变量更改为 soccer_ans。这是测试变量
  • 点击 ,将 Soccer Field 拖动到测试语句下的 if 区块内部。
  • 变量 soccer_ans 存储用户的回答。 符号 == 检查该响应是否为字符串 "yes"

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)