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 ejercicio-01
- Loading branch information
Showing
50 changed files
with
4,700 additions
and
983 deletions.
There are no files selected for viewing
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
37 changes: 37 additions & 0 deletions
37
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/java/jaimeNar.java
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,37 @@ | ||
public class jaimeNar { | ||
public static void main(String args[]) { | ||
// URL del sitio web oficial | ||
/** | ||
* https://www.java.com | ||
**/ | ||
|
||
// Diferentes sintáxis para crear comentarios | ||
// Comentario de una sola línea | ||
|
||
/* | ||
* Comentario de varias líneas | ||
*/ | ||
|
||
/** | ||
* Otro comentario de varias líneas | ||
**/ | ||
|
||
int variable; // Variable | ||
|
||
final int constant; // Constante | ||
|
||
// Variables que representan los tipos de datos primitivos | ||
byte by = 127; | ||
short num_sh = 32767; | ||
int num = 234567834; | ||
long num_long = 456546465L; | ||
float num_float = 1.5f; | ||
double num_double = 3.7; | ||
char character = 'A'; | ||
boolean bool = true; | ||
|
||
// Imprime por terminal el texto: "¡Hola, [y el nombre de tu lenguaje]!" | ||
System.out.println("¡Hola, Java!"); | ||
} | ||
} | ||
|
35 changes: 35 additions & 0 deletions
35
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/javascript/miguelRejon96.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,35 @@ | ||
// Sitio oficial de Javascript: https://developer.mozilla.org/es/docs/Web/JavaScript | ||
|
||
//Este es un comentario en una línea | ||
/* | ||
Este es un comentario en varías líneas | ||
*/ | ||
|
||
//Constante | ||
const greetings = 'Hello' | ||
|
||
//Variable | ||
let language = 'Javascript' | ||
|
||
//Tipos de datos: | ||
|
||
//String | ||
const thiIsAString = 'This is a string' | ||
|
||
//Number | ||
const thisIsANumber = 1 | ||
|
||
//BigInt | ||
const thisIsABigInt = BigInt(9007199254740991) | ||
|
||
//Boolean | ||
const thisIsABoolean = true | ||
|
||
//Undefined | ||
let thisIsAnUndefined | ||
|
||
//Symbol | ||
const thisIsASymbol = Symbol() | ||
|
||
|
||
console.log(`${greetings} ${language}`) |
25 changes: 25 additions & 0 deletions
25
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/python/ArliumDev.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,25 @@ | ||
# Sitio web oficial: https://www.python.org/ | ||
|
||
# Esto es un comentario | ||
|
||
""" | ||
Esto es | ||
un comentario | ||
multilínea | ||
""" | ||
|
||
''' | ||
Esto es | ||
otro comentario | ||
multilínea | ||
''' | ||
|
||
my_string = "Soy un string" | ||
|
||
my_int = 1 | ||
|
||
my_double = 1.2 | ||
|
||
my_boolean = True | ||
|
||
print('¡Hola, Python!') |
34 changes: 34 additions & 0 deletions
34
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/python/owen-ian.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,34 @@ | ||
# URL del sitio web oficial de Python: https://www.python.org/ | ||
|
||
# La amohadilla nos permite escribir un comentario de una sola línea | ||
|
||
""" | ||
Las comillas dobles nos permiten | ||
escribir un comentario de varias líneas | ||
""" | ||
|
||
''' | ||
Las comillas simples tambien nos permiten | ||
escribir un comentario de varias líneas | ||
''' | ||
|
||
# Variable | ||
my_variable = "Una variable en Python" | ||
|
||
# Constante | ||
MY_CONSTANTE = "Una constante en Python" # Aclaracion, al parecer la gente escribe sus constantes en MAYUSCULAS | ||
|
||
my_int = 1 | ||
my_float = 1.5 | ||
my_bool = True | ||
my_bool = False | ||
my_string = "Cadena de texto" | ||
my_other_string = 'Otra cadena de texto' | ||
|
||
# Imprimir por terminal | ||
print("¡Hola, Python!") | ||
|
||
print(type(my_int)) | ||
print(type(my_float)) | ||
print(type(my_bool)) | ||
print(type(my_string)) |
129 changes: 129 additions & 0 deletions
129
Roadmap/01 - OPERADORES Y ESTRUCTURAS DE CONTROL/javascript/miguelRejon96.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,129 @@ | ||
/* | ||
* EJERCICIO: | ||
* - Crea ejemplos utilizando todos los tipos de operadores de tu lenguaje: | ||
* Aritméticos, lógicos, de comparación, asignación, identidad, pertenencia, bits... | ||
* (Ten en cuenta que cada lenguaje puede poseer unos diferentes) | ||
* - Utilizando las operaciones con operadores que tú quieras, crea ejemplos | ||
* que representen todos los tipos de estructuras de control que existan | ||
* en tu lenguaje: | ||
* Condicionales, iterativas, excepciones... | ||
* - Debes hacer print por consola del resultado de todos los ejemplos. | ||
* | ||
* DIFICULTAD EXTRA (opcional): | ||
* Crea un programa que imprima por consola todos los números comprendidos | ||
* entre 10 y 55 (incluidos), pares, y que no son ni el 16 ni múltiplos de 3. | ||
* | ||
* Seguro que al revisar detenidamente las posibilidades has descubierto algo nuevo. | ||
*/ | ||
|
||
//Operadores Aritméticos | ||
let x = 10; | ||
let y = 5; | ||
console.log("Suma: ", x + y); //Suma | ||
console.log("Resta: ", x - y); //Resta | ||
console.log("Multiplicación: ", x * y); //Multiplicación | ||
console.log("División", x / y); //División | ||
console.log("Residuo", x % y); //Residuo | ||
console.log("Exponenciación: ", x ** y); //Exponenciación | ||
|
||
//Operadores de asignación | ||
let a = 10; | ||
a += 3; // a = a +3 | ||
console.log("a += 3: ", a); | ||
a -= 3; // a = a - 3 | ||
console.log("a -= 3: ", a); | ||
a *= 3; // a = a * 3 | ||
console.log("a *= 3: ", a); | ||
a /= 3; // a = a / 3 | ||
console.log("a /= 3: ", a); | ||
a %= 3; // a = a % 3 | ||
console.log("a %= 3: ", a); | ||
a **= 3; // a = a ** 3 | ||
console.log("a **= 3: ", a); | ||
|
||
//Operadores de comparación | ||
let b = 5; | ||
console.log("a == b: ", a == b); //Igualdad | ||
console.log("a === b: ", a === b); //Igualdad estricta | ||
console.log("a != b: ", a != b); //Desigualdad | ||
console.log("a !== b: ", a !== b); //Desigualdad estricta | ||
console.log("a > b: ", a > b); //Mayor que | ||
console.log("a < b: ", a < b); //Menor que | ||
console.log("a >= b: ", a >= b); //Mayor o igual que | ||
console.log("a <= b: ", a <= b); //Menor o igual que | ||
|
||
//Operadores lógicos | ||
console.log("true && false: ", true && false); // AND | ||
console.log("true || false: ", true || false); // OR | ||
console.log("!true: ", !true); //NOT | ||
|
||
//Operadores de Bits | ||
console.log(x << y); //Desplazamiento a la izquierda | ||
console.log(x >> y); //Desplazamiento a la derecha | ||
console.log(x >>> y); //Desplazamiento a la derecha sin signo | ||
console.log(x & y); //Asignación AND bit a bit | ||
console.log(x ^ y); //Asignación XOR bit a bit | ||
console.log(x | y); //Asignación OR bit a bit | ||
console.log(x && (x = y)); //Asignación AND lógico | ||
console.log(x || (x = y)); //Asignación OR lógico | ||
console.log(x ?? (x = y)); //Asignación de anulación lógica | ||
|
||
//Estucturas de control | ||
|
||
// Condicionales | ||
|
||
if (x > y) { | ||
console.log("x es mayor que y"); | ||
} else { | ||
console.log("x no es mayor que y"); | ||
} | ||
|
||
let z = 3; | ||
switch (z) { | ||
case 1: | ||
console.log("Z es 1"); | ||
break; | ||
case 2: | ||
console.log("Z es 2"); | ||
break; | ||
case 3: | ||
console.log("z es 3"); | ||
break; | ||
default: | ||
console.log("z no es 1,2 o 3"); | ||
} | ||
|
||
//Iterativas | ||
for (let i = 0; i < 5; i++) { | ||
console.log("For loop i: ", i); | ||
} | ||
let j = 0; | ||
while (j < 5) { | ||
console.log("while loop j: ", j); | ||
j++; | ||
} | ||
let k = 0; | ||
do { | ||
console.log("do while loop k: ", k); | ||
k++; | ||
} while (k < 5); | ||
|
||
//Excepciones | ||
try { | ||
throw new error("Error"); | ||
} catch (error) { | ||
console.log("Mensaje: ", error.message); | ||
} finally { | ||
console.log("Finally"); | ||
} | ||
|
||
//Ejercicio Extra | ||
function extraExercise() { | ||
for (let i = 10; i <= 55; i++) { | ||
if (i % 2 == 0 && i !== 16 && i % 3 !== 0) { | ||
console.log(i); | ||
} | ||
} | ||
} | ||
|
||
extraExercise(); |
82 changes: 82 additions & 0 deletions
82
Roadmap/01 - OPERADORES Y ESTRUCTURAS DE CONTROL/python/saicobys.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,82 @@ | ||
# Operadores aritméticos | ||
x = 10 | ||
y = 3 | ||
suma = x + y | ||
resta = x - y | ||
multiplicacion = x * y | ||
division = x / y | ||
division_entera = x // y | ||
modulo = x % y | ||
potencia = x ** y | ||
|
||
print("Suma:", suma) | ||
print("Resta:", resta) | ||
print("Multiplicacion:", multiplicacion) | ||
print("Division:", division) | ||
print("division entera:", division_entera) | ||
print("Modulo:", modulo) | ||
print("Potencia:", potencia) | ||
|
||
# Operadores de comparacion | ||
a = 5 | ||
b = 8 | ||
print("a == b:", a == b) | ||
print("a != b:", a != b) | ||
print("a > b:", a > b) | ||
print("a < b:", a < b) | ||
print("a >= b:", a >= b) | ||
print("a <= b:", a <= b) | ||
|
||
# Operadores lógicos | ||
c = True | ||
d = False | ||
print("c and d:", c and d) | ||
print("c or d:", c or d) | ||
print("not c:", not c) | ||
|
||
# Operadores de asignación | ||
e = 15 | ||
e += 5 # e = e + 5 | ||
print("e += 5:", e) | ||
e -= 3 # e = e - 3 | ||
print("e -= 3:", e) | ||
|
||
# Operadores de identidad | ||
f = [1, 2, 3] | ||
g = [1, 2, 3] | ||
h = f | ||
print("f is g:", f is g) # False (objetos diferentes) | ||
print("f is h:", f is h) # True (misma referencia) | ||
print("f == g:", f == g) # True (mismo contenido) | ||
|
||
# Operadores de pertenencia | ||
lista = [1, 2, 3, 4] | ||
print("1 in lista:", 1 in lista) | ||
print("5 in lista:", 5 in lista) | ||
|
||
# Condicionales | ||
edad = 25 | ||
|
||
if edad < 18: | ||
print("Eres menor de edad") | ||
elif edad >= 18 and edad < 65: | ||
print("Eres adulto") | ||
else: | ||
print("Eres jubilado") | ||
|
||
# Iterativas (bucles) | ||
for i in range(1, 6): # Imprime números del 1 al 5 | ||
print(i) | ||
|
||
numero = 1 | ||
while numero <= 5: # Imprime números del 1 al 5 | ||
print(numero) | ||
numero += 1 | ||
|
||
# Excepciones | ||
try: | ||
resultado = 10 / 0 # División por cero (error) | ||
except ZeroDivisionError as e: | ||
print("Error:", e) | ||
finally: | ||
print("Fin del programa") |
Oops, something went wrong.