-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 #16-Python
- Loading branch information
Showing
44 changed files
with
6,652 additions
and
1,064 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
29 changes: 29 additions & 0 deletions
29
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/c/1ceL4nc3.c
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,29 @@ | ||
https://www.cprogramming.com | ||
|
||
Types of comments | ||
// // = // comment // | ||
/* */ = /* comment */ | ||
|
||
// constant value = const + type of variable + name of variable // | ||
const int n = 5; | ||
|
||
//Data types // | ||
char character = 'a'; // Single character, 1 byte // | ||
int integer = 9; // Signed integer in base 10, 4 bytes// | ||
float decimal = 1.5; // Floating point number with six digits of precision, 4 bytes // | ||
double decimalDouble = -2456.4452; // Hold about 15 to 16 digits after and before any given decimal point, 8 bytes // | ||
long longinteger = 132344546L; // Signed long integer, 4 bytes // | ||
short shortinteger = 128; // Short signed integer, 2 bytes // | ||
unsigned unsignedinteger = 50; // Unsigned integer in base 10, 4 bytes // | ||
unsigned long unsignedlonginteger = 451345245UL; // Unsigned long long integer, 8 bytes // | ||
unsigned short unsignedshortinteger = 256; // Short unsigned integer, 2 bytes // | ||
|
||
#include <stdio.h> // header function | ||
|
||
int main() // main function | ||
{ // indicates the beginning and end of functions and other code blocks // | ||
char l_name = 'C'; // create a variable named l_name and assign it the character C // | ||
|
||
printf("!Hola %c!\n", l_name); // print the string !Hola + variable l_name// // %c indicates that the funtion is printing a character// // \n print another line// | ||
|
||
} |
29 changes: 29 additions & 0 deletions
29
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/java/queralesDev.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,29 @@ | ||
|
||
public class queralesDev { | ||
public static void main(String[] args) { | ||
/* | ||
https://www.java.com/es/ | ||
*/ | ||
|
||
/* | ||
Las diferentes sintaxis para crear comentarios son las siguientes | ||
/* Esto es Comentario de varias lineas | ||
//comentario de una sola linea | ||
///comentario de una sola linea tambien | ||
*/ | ||
|
||
int numeroEntero; | ||
String JAVA = "Soy una constante"; | ||
|
||
byte numero; | ||
int numeroEntero2; | ||
short numeroCorto; | ||
long numeroLargo; | ||
double numeroConComa; | ||
char caracter; | ||
float numeroConComa2; | ||
|
||
System.out.printf("Hola soy java"); | ||
|
||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/javascript/Erysnell.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,15 @@ | ||
// https://developer.mozilla.org/es/docs/Web/JavaScript | ||
|
||
// comentarios de una sola linea | ||
/*comentarios | ||
de varias lineas*/ | ||
|
||
let variable; | ||
const constante = 5; | ||
|
||
let number = 1; | ||
let string = 'string'; | ||
let boolean = true; | ||
let array = [1,2,3]; | ||
|
||
console.log("Hola Javascript"); |
28 changes: 28 additions & 0 deletions
28
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/python/Dkp-Dev.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,28 @@ | ||
# 1.Crea un comentario en el código y coloca la URL del sitio web oficial del lenguaje de programación que has seleccionado. | ||
# Empezamos de cero! | ||
|
||
# https://www.python.org | ||
|
||
""" | ||
Este es | ||
un comentario | ||
en 3 lineas | ||
""" | ||
# 2.Crea una variable (y una constante si el lenguaje lo soporta). | ||
variable = "Mi Variable" | ||
MY_CONSTANT = "Constante" # Esta constante puede mutar, pero al estar en mayusculas, por convencion nadie la deberia de cambiar | ||
|
||
# 3.Crea variables representando todos los tipos de datos primitivos | ||
int_var = 7 | ||
float_var = 2.5 | ||
bool_var = True | ||
bool2_var = False | ||
string_var = "Cadena de texto" | ||
string2_var = 'Cadena de texto con comilla simple' | ||
|
||
# 4.Imprime por terminal el texto: "¡Hola, [y el nombre de tu lenguaje]!" | ||
|
||
YO = "Dkp-Dev!" | ||
PYTHON = "Python!!" | ||
|
||
print("Hola", PYTHON, "soy ",YO) |
23 changes: 23 additions & 0 deletions
23
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/python/jandortiz.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 @@ | ||
# Parte 1. | ||
# https://www.python.org/ | ||
|
||
# Parte 2. | ||
# Esto es un primer comentario. | ||
|
||
""" | ||
Otra forma de realizar | ||
comentarios de varias líneas. | ||
""" | ||
|
||
# Parte 3. | ||
mi_primera_variable = 3 | ||
HORAS_DIA = 24 | ||
|
||
# Parte 4. | ||
numero_entero = 54 | ||
numero_decimal = 43.2 | ||
cadena_texto = "Hola mundo" | ||
variable_booleana = True | ||
variable_none = None | ||
|
||
print("¡Hola, Python!") |
29 changes: 29 additions & 0 deletions
29
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/python/jheisonquiroga.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,29 @@ | ||
#https://www.python.org/ | ||
#1. Sintaxis de creacion de comentarios | ||
#1.1. Para una sola linea se utilizan los numerales (#) | ||
""" | ||
1.2. Comentar varias lineas: Se utilizan las comillas dobles o simples triples | ||
""" | ||
''' | ||
1.2. Comentar varias lineas: Se utilizan las comillas dobles o simples triples | ||
''' | ||
#2. Crea una variable y una constante si el lenguaje lo soporta | ||
mi_variable = 69 | ||
|
||
#2.1. Costante | ||
PI = 3.1416 | ||
|
||
#3. Tipos de datos | ||
|
||
cadena = "string" #Cadena de texto (str) | ||
numero_entero = 10 # Numero entero (int) | ||
numero_flotante = 3.5 # Numero flotante (float) | ||
booleano = True # Valor booleano (bool) | ||
lista = [1,2,3] # Lista (list) | ||
tupla = (1,2,3) # tupla (tuple) | ||
diccionario = {"clave" : "valor"} #Diccionario (dict) | ||
|
||
nombre_lenguaje = "Python" | ||
print(f"¡Hola, {nombre_lenguaje}!") | ||
|
||
|
24 changes: 24 additions & 0 deletions
24
Roadmap/00 - SINTAXIS, VARIABLES, TIPOS DE DATOS Y HOLA MUNDO/python/jmontoyac.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,24 @@ | ||
# https://www.python.org/ | ||
|
||
# Comentario de una linea | ||
|
||
''' | ||
# Comentario multi lineas | ||
# Segunda linea de comentario | ||
''' | ||
|
||
# Variable en Python | ||
primera_variable = 0 | ||
|
||
# Constante en Python | ||
DURACION_MILISEGUNDOS = 300 | ||
|
||
# Tipos de datos primitivos | ||
variable_string_comillas_simples = 'String de comillas simples' | ||
Variable_string_comillas_dobles = "String de comillas dobles" | ||
variable_int = 3600 | ||
variable_float = 5.5 | ||
variable_boolean = True | ||
variable_nula = None | ||
|
||
print("¡Hola Python!") |
136 changes: 136 additions & 0 deletions
136
Roadmap/01 - OPERADORES Y ESTRUCTURAS DE CONTROL/c++/oixild.cpp
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,136 @@ | ||
/* | ||
* 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. | ||
* | ||
* Seguro que al revisar detenidamente las posibilidades has descubierto algo nuevo. | ||
*/ | ||
|
||
|
||
#include <iostream> | ||
#include <vector> | ||
#include <exception> // Para manejo de excepciones | ||
|
||
using namespace std; | ||
|
||
int main() { | ||
// ** Operadores aritméticos ** | ||
int a = 10; | ||
int b = 3; | ||
|
||
cout << "Operadores aritméticos:" << endl; | ||
cout << "Suma: " << a + b << endl; // Suma | ||
cout << "Resta: " << a - b << endl; // Resta | ||
cout << "Multiplicación: " << a * b << endl; // Multiplicación | ||
cout << "División: " << a / b << endl; // División | ||
cout << "Módulo: " << a % b << endl; // Módulo | ||
cout << "Incremento: " << ++a << endl; // Incremento | ||
cout << "Decremento: " << --b << endl; // Decremento | ||
|
||
// ** Operadores de asignación ** | ||
cout << "\nOperadores de asignación:" << endl; | ||
a = 5; | ||
cout << "a = 5 -> " << a << endl; | ||
a += 2; | ||
cout << "a += 2 -> " << a << endl; | ||
a -= 1; | ||
cout << "a -= 1 -> " << a << endl; | ||
a *= 3; | ||
cout << "a *= 3 -> " << a << endl; | ||
a /= 2; | ||
cout << "a /= 2 -> " << a << endl; | ||
a %= 3; | ||
cout << "a %= 3 -> " << a << endl; | ||
|
||
// ** Operadores de comparación ** | ||
cout << "\nOperadores de comparación:" << endl; | ||
cout << "a == b: " << (a == b) << endl; // Igualdad | ||
cout << "a != b: " << (a != b) << endl; // Diferente | ||
cout << "a < b: " << (a < b) << endl; // Menor que | ||
cout << "a > b: " << (a > b) << endl; // Mayor que | ||
cout << "a <= b: " << (a <= b) << endl; // Menor o igual que | ||
cout << "a >= b: " << (a >= b) << endl; // Mayor o igual que | ||
|
||
// ** Operadores lógicos ** | ||
cout << "\nOperadores lógicos:" << endl; | ||
bool x = true; | ||
bool y = false; | ||
cout << "x && y: " << (x && y) << endl; // AND lógico | ||
cout << "x || y: " << (x || y) << endl; // OR lógico | ||
cout << "!x: " << !x << endl; // NOT lógico | ||
|
||
// ** Operadores de bits ** | ||
cout << "\nOperadores de bits:" << endl; | ||
int c = 5; // 0101 en binario | ||
int d = 9; // 1001 en binario | ||
cout << "c & d: " << (c & d) << endl; // AND a nivel de bits | ||
cout << "c | d: " << (c | d) << endl; // OR a nivel de bits | ||
cout << "c ^ d: " << (c ^ d) << endl; // XOR a nivel de bits | ||
cout << "~c: " << ~c << endl; // NOT a nivel de bits | ||
cout << "c << 1: " << (c << 1) << endl; // Desplazamiento a la izquierda | ||
cout << "c >> 1: " << (c >> 1) << endl; // Desplazamiento a la derecha | ||
|
||
// ** Estructuras de control: Condicionales ** | ||
cout << "\nEstructuras de control - Condicionales:" << endl; | ||
if (a > b) { | ||
cout << "a es mayor que b" << endl; | ||
} | ||
else { | ||
cout << "a no es mayor que b" << endl; | ||
} | ||
|
||
// ** Estructuras de control: Iterativas ** | ||
cout << "\nEstructuras de control - Iterativas:" << endl; | ||
cout << "Bucle for:" << endl; | ||
for (int i = 0; i < 3; i++) { | ||
cout << "i = " << i << endl; | ||
} | ||
|
||
cout << "Bucle while:" << endl; | ||
int i = 0; | ||
while (i < 3) { | ||
cout << "i = " << i << endl; | ||
i++; | ||
} | ||
|
||
cout << "Bucle do-while:" << endl; | ||
i = 0; | ||
do { | ||
cout << "i = " << i << endl; | ||
i++; | ||
} while (i < 3); | ||
|
||
// ** Estructuras de control: Manejo de excepciones ** | ||
cout << "\nEstructuras de control - Excepciones:" << endl; | ||
try { | ||
int divisor = 0; | ||
if (divisor == 0) { | ||
throw runtime_error("Error: División entre cero"); | ||
} | ||
int resultado = 10 / divisor; | ||
cout << "Resultado: " << resultado << endl; | ||
} | ||
catch (const exception& e) { | ||
cout << e.what() << endl; | ||
} | ||
|
||
// ** Dificultad Extra ** | ||
cout << "\nDificultad Extra:" << endl; | ||
|
||
int num = 10; | ||
while (num <= 55) { | ||
if (num % 2 == 0 && num % 3 != 0 && num % 16 != 0) { | ||
cout << num << " " << endl; | ||
num++; | ||
} | ||
num++; | ||
} | ||
return 0; | ||
} |
Oops, something went wrong.