第 5步:让我们调整随机生成器,使其仅生成 1 到 6 之间的数字。

  • 首先,将变量名从my_var更改为outcome
  • 然后,将randint()中的第二个参数从10更改为6 。 (因为骰子只有六个面。)

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)