Skip to content

Instantly share code, notes, and snippets.

@macagua
Created September 27, 2018 02:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save macagua/637116aec6892fa911c6522ada09c497 to your computer and use it in GitHub Desktop.
Save macagua/637116aec6892fa911c6522ada09c497 to your computer and use it in GitHub Desktop.
Uso tipado dinámico en Python 3.5.x
""" 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))
<class 'int'>
>>> variable = "activo"
>>> print ((variable), type(variable))
<class '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