第 4 步:让我们学习如何检查变量或值的数据类型!这样我们就知道我们正在处理什么。

要检查变量或值的数据类型,请将type()与括号中的变量或值一起使用。

  • ,将Print Type拖到程序的下一行。
  • 将字符串更改为"Data type of calc_1a is" ,并将type( my_var )更改为type( calc_1a )
  • 点击运行,输入一个数字,然后查看输出。它显示什么数据类型?

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)