Last active
September 27, 2018 02:48
-
-
Save macagua/bf96adbe4c129aee16e7cc0c3e58cc48 to your computer and use it in GitHub Desktop.
Uso tipado dinámico en Python 2.7.x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf8 -*- | |
""" El tipado dinámico significa que los objetos en tiempo de | |
ejecución (valores) tienen un tipo, a diferencia del tipado | |
estático donde las variables tienen un tipo. | |
>>> variable = 11 | |
>>> print variable, type(variable) | |
11 <type 'int'> | |
>>> variable = "activo" | |
>>> print (variable), type(variable) | |
activo <type 'str'> | |
""" | |
variable = 11 # "variable" guarda un valor entero | |
print variable, type(variable) | |
variable = "activo" # "variable" guarda un valor cadena | |
print (variable), type(variable) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment