警告:这个程序有一个我们需要调试的错误。

您可以在字符串和变量之间使用逗号来输出它们,而不必将每个值转换为字符串。

  • 点击运行并输入一个数字作为输入。阅读出现的错误消息。
  • “无法连接 str 和 int...”是我们之前通过使用str()转换数字解决的错误。
  • 这次,通过用逗号替换加号来修复错误!这避免了需要强制转换为字符串。

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)