forked from mouredev/roadmap-retos-programacion
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mouredev:main' into main
- Loading branch information
Showing
19 changed files
with
2,575 additions
and
776 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/python/Ipfabio.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# https://www.python.org/ | ||
|
||
""" | ||
Esto es | ||
un comentario | ||
multilinea | ||
""" | ||
|
||
''' | ||
Esto también es | ||
un comentario | ||
multilinea | ||
''' | ||
|
||
saludo = "Hola" | ||
CONSTANTE = "Mi 'constante'" # No me cambies. | ||
|
||
my_int = 1 | ||
my_float = 2.5 | ||
my_bool = True | ||
my_bool = False | ||
|
||
print(f'{saludo}, elijo Python') |
72 changes: 72 additions & 0 deletions
72
Roadmap/01 - OPERADORES Y ESTRUCTURAS DE CONTROL/javascript/TizoG.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// Ejemplos de Operadores | ||
|
||
console.log(1 + 1) // Suma | ||
console.log(1 - 1) // Resta | ||
console.log(2 * 2) // Multiplicacion | ||
console.log(2 / 2) // Division | ||
console.log(5 % 2) // Modulo | ||
console.log(2 ** 2) // Potenciacion | ||
|
||
// Operaciones con enteros | ||
|
||
console.log(3 < 2) | ||
console.log(3 <= 2) | ||
console.log(3 > 2) | ||
console.log(3 >= 2) | ||
console.log(3 == 2) | ||
console.log(3 === 2) | ||
console.log(3 != 2) | ||
|
||
// Operadores logicos | ||
console.log(3 < 2 && "hola" < "mundo") | ||
console.log(3 < 2 || "hola" < "mundo") | ||
console.log(!false) | ||
|
||
// Operadores de asignacion | ||
let myNumber = 1 | ||
console.log(myNumber) | ||
myNumber += 1 | ||
console.log(myNumber) | ||
myNumber -= 1 | ||
console.log(myNumber) | ||
myNumber *= 1 | ||
console.log(myNumber) | ||
myNumber /= 1 | ||
console.log(myNumber) | ||
myNumber %= 1 | ||
console.log(myNumber) | ||
myNumber **= 1 | ||
console.log(myNumber) | ||
|
||
|
||
// Incremento | ||
myNumber++ | ||
// Decremento | ||
myNumber-- | ||
|
||
/* | ||
Estructuras de control | ||
*/ | ||
// Condicionales | ||
let myName = "TizoG" | ||
if (myName == "TizoG") { | ||
console.log("myName es 'TizoG'") | ||
} else if(myName == "tizog"){ | ||
console.log("myName es 'tizog'") | ||
} else{ | ||
console.log("miName no es 'TizoG' ni 'tizog'") | ||
} | ||
|
||
// Iteracion | ||
for (let i = 0; i < 10; i++){ | ||
console.log(`El valor actual de i es ${i}`) | ||
} | ||
|
||
// Manejo de excepciones | ||
try{ | ||
console.log("Primero se ejecutara este bloque") | ||
}catch{ | ||
console.log("Este bloque se ejecutara si en el bloque primero ocurre un error") | ||
}finally{ | ||
console.log("Finalmente se ejecutara este bloque de codigo") | ||
} |
101 changes: 101 additions & 0 deletions
101
Roadmap/01 - OPERADORES Y ESTRUCTURAS DE CONTROL/python/TizoG.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
# Ejemplos de Operadores | ||
|
||
print(1 + 1) # Suma | ||
print(1 - 1) # Resta | ||
print(2 * 2) # Multiplicacion | ||
print(2 / 2) # Division | ||
print(5 % 2) # Modulo | ||
print(10 // 3) # Division con resultado entero forzado | ||
print(2 ** 2) # Potenciacion | ||
|
||
# Operaciones con enteros | ||
print(3 < 2) # Menor | ||
print(3 > 2) # Mayor | ||
print(3 <= 2) # Menor o Igual | ||
print(3 >= 2) # Mayor o Igual | ||
print(3 == 2) # Igualdad | ||
print(3 != 2) # Desigualdad | ||
|
||
# Operadores Logicos | ||
print(3 < 2 and "hola" < "mundo") # Retorna verdadero si ambos son verdadero | ||
print(3 < 2 or "hola" < "mundo") # Retorna verdad si uno de los dos es verdadero | ||
print(3 > 2 and "hola" > "mundo") | ||
print(3 > 2 or "hola" > "mundo") | ||
print(not(3 > 4)) # Da el valor contrario | ||
|
||
# Operadores de asignación | ||
my_number = 1 | ||
print(my_number) | ||
my_number += 1 # suma y asignación | ||
print(my_number) | ||
my_number -= 1 | ||
print(my_number) | ||
my_number *= 2 | ||
print(my_number) | ||
my_number /= 2 | ||
print(my_number) | ||
my_number %= 2 | ||
print(my_number) | ||
my_number **= 2 | ||
print(my_number) | ||
my_number //= 1 | ||
print(my_number) | ||
|
||
|
||
|
||
# Operadores de identidad | ||
my_nuevo_numero = my_number | ||
print(f"my_number is my_nuevo_numero es {my_number is my_nuevo_numero}") | ||
print(f"my_numer is not my_nuevo_numero {my_number is not my_nuevo_numero}") | ||
|
||
# Operadores de pertenencia | ||
print(f"'i' in 'TizoG' = {'i' in 'TizoG'}") | ||
print(f"'a' in 'TizoG' = {'a' in 'TizoG'}") | ||
|
||
# Operadores de bit | ||
a = 5 | ||
b = 2 | ||
print(f"AND : 5 & 2 = {5 & 2}") | ||
print(f"OR: 5 | 2 = {5| 2}") | ||
print(f"XOR: 5 ^ 2 = {5 ^ 2}") | ||
print(f"Desplazamiento a la derecha: 5 >> 2 = {5 >> 2}") | ||
print(f"Desplazamiento a la izquierda: 5 << 2 = {5 << 2}") | ||
|
||
""" | ||
Estructuras de control | ||
""" | ||
|
||
# Condicionales | ||
my_name = "TizoG" | ||
if my_name == "TizoG": | ||
print("my_name is 'TizoG'") | ||
elif my_name == "tizog": | ||
print("my_name is 'tizog'") | ||
else: | ||
print("my_name no es 'TizoG' ni 'tizog'") | ||
|
||
# Iterativas | ||
for i in range(11): | ||
print(i) | ||
|
||
i = 0 | ||
while i <= 10: | ||
print(i) | ||
i += 1 | ||
|
||
# Manejo de excepciones | ||
try: | ||
print(10 /0) | ||
except: | ||
print("Se ha produicido un error") | ||
finally: | ||
print("ha finalizado el manejo de excepciones") | ||
|
||
|
||
""" | ||
Extra | ||
""" | ||
|
||
for number in range(10, 56): | ||
if number % 2 == 0 and number != 16 and number % 3 != 0: | ||
print(number) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
# Funciones basicas sin retorno | ||
def saludo(): | ||
print("Hola mundo") | ||
|
||
|
||
saludo() | ||
|
||
# Funcion con retorno | ||
|
||
|
||
def saludo_retorno(): | ||
return "Hola mundo" | ||
|
||
|
||
print(saludo_retorno()) | ||
|
||
# Con un argumento | ||
|
||
|
||
def arg_saludo(nombre): | ||
print(f"Hola {nombre}") | ||
|
||
|
||
print(arg_saludo("Juan")) | ||
|
||
# Con argumentos | ||
|
||
|
||
def argts_saludo(nombre, apellido): | ||
print(f"hola {nombre} {apellido}") | ||
|
||
|
||
argts_saludo("Juan", "Yesca") | ||
|
||
# Con argumentos predefinidos | ||
|
||
|
||
def arg_definido(nombre="Juan"): | ||
print(f"Hola {nombre}") | ||
|
||
|
||
arg_definido() | ||
arg_definido("Juanito") | ||
|
||
# Con argumento y retorno | ||
|
||
|
||
def ret_arg(nombre, apellido): | ||
return f"Hola {nombre} {apellido}" | ||
|
||
|
||
print(ret_arg("Juan", "Yesca")) | ||
|
||
# Con un numero variable de argumentos | ||
|
||
|
||
def num_arg(*nombres): | ||
for nombre in nombres: | ||
print(f"Hola {nombre}") | ||
|
||
|
||
num_arg("Juan", "Yesca", "Pedro", "Maria") | ||
|
||
|
||
""" | ||
Funciones dentro de funciones | ||
""" | ||
|
||
|
||
def funcion_out(): | ||
def funcion_in(): | ||
print("Hola mundo") | ||
funcion_in() | ||
|
||
|
||
funcion_out() | ||
|
||
# Funciones del lenguaje | ||
print(len("Juan")) | ||
print(type("Juan")) | ||
print("Juan".upper()) | ||
|
||
""" | ||
Variables globales y locales | ||
""" | ||
var_global = "Juan" | ||
|
||
|
||
def hola_juan(): | ||
var_local = "Juanito" | ||
print(f"{var_global}, {var_local}") | ||
|
||
|
||
print(var_global) | ||
hola_juan() | ||
|
||
|
||
""" | ||
Extra | ||
""" | ||
|
||
|
||
def print_numeros(texzto1, texto2) -> int: | ||
count = 0 | ||
for numeros in range(1, 101): | ||
if numeros % 3 == 0 and numeros % 5 == 0: | ||
print(texzto1 + texto2) | ||
elif numeros % 3 == 0: | ||
print(texzto1) | ||
elif numeros % 5 == 0: | ||
print(texto2) | ||
else: | ||
print(numeros) | ||
count += 1 | ||
return count | ||
|
||
|
||
print(print_numeros("Fizz", "Buzz")) |
Oops, something went wrong.