PASO 4: ¡Aprendamos cómo verificar el tipo de datos de una variable o valor! De esta manera sabemos con qué estamos trabajando.

Para verificar el tipo de datos de una variable o valor, use type() con la variable o el valor entre paréntesis.

  • Desde , arrastre Print Type a la siguiente línea del programa.
  • Cambie la cadena a "Data type of calc_1a is" y cambie type( my_var ) a type( calc_1a ) .
  • Hacer clic Ejecute , ingrese un número y observe el resultado. ¿Qué tipo de datos muestra?

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
  • Enviar Trabajo
  • Actividad Siguiente
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)