STEP 4: Let's learn how to check the data type of a variable or value! This way we know what we're working with.

To check the data type of a variable or value, use type() with the variable or value in the parentheses.

  • From , drag Print Type onto the next line in the program.
  • Change the string to "Data type of calc_1a is" and change type(my_var) to type(calc_1a).
  • Click Run, enter a number, and look at the output. What data type does it show?

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
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)