第5步:为程序设置随机变量。

我们使用一个变量来存储生成的随机值。更改参数,以获得一个1到4之间的数字。

  • 将随机变量重命名为 rand_answer
  • .Display() 中的变量名称更改为 rand_answer
  • 将.randint() 中的第二个整数更改为 4

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)