From 5b4837aec24032741b0ee130158717c51f1f0747 Mon Sep 17 00:00:00 2001 From: Ana Victoria De la Vega Pando <101435549+NyxtByteX@users.noreply.github.com> Date: Mon, 10 Nov 2025 13:37:11 -0500 Subject: [PATCH] #00 - Python MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Solución del reto 00 por NyxtByteX --- .../python/NyxtByteX.py | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/python/NyxtByteX.py diff --git a/Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/python/NyxtByteX.py b/Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/python/NyxtByteX.py new file mode 100644 index 0000000000..7344997b6a --- /dev/null +++ b/Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/python/NyxtByteX.py @@ -0,0 +1,52 @@ +# https://www.python.org + +# Comentario en una línea + +""" +Esto también es +un comentario +en varias líneas +""" + +''' +Esto también es +un comentario +en varias líneas +''' + +#¿Qué es una variable? +# Una variable es un nombre que guarda un valor en memoria. +my_variable = "Mi variable" +my_variable = "Nuevo valor de mi variable" + +# Las constantes se escriben en MAYÚSCULAS por convención, +# aunque técnicamente sí se puede cambiar. +MY_CONSTANT = "Mi constante" # por convención + +# Tipos de datos básicos en Python +my_int = 1 # int (entero) +my_float = 1.5 # float (decimal) +my_bool = True # bool (booleano) +my_bool = False # bool (booleano) +my_string = "Mi cadena de texto" # str (cadena de texto) +my_other_string = 'Mi otra cadena de texto' + +# Puedes usar type() para saber el tipo de dato +print(type(my_int)) # + +# Imprimir mensaje en consola +print("¡Hola, Python!") + +# Saber el tipo de dato +print(type(my_int)) +print(type(my_float)) +print(type(my_bool)) +print(type(my_string)) +print(type(my_other_string)) + +# Concatenar texto con variables (cómo imprimir valores) +nombre = "Ana" +print("Hola " + nombre) + +# Mejor forma: f-string +print(f"Hola {nombre}")