18 步:我们已经划分了数字,但如果我们想知道余数怎么办?

  • 删除在divide()函数内缩进的Remainder
  • 将变量名从my_var更改为remainder 。将7更改为num_1 ,将3更改为num_2
  • 添加Say 。将字符串更改为"The remainder is " + str( remainder ) .

模 (%) 是一种特殊的数学运算符,用于计算两个数相除的余数。

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)