-
Recent Posts
Recent Comments
Archives
Categories
Meta
Tag Archives: #Mastery24
MASTERY 24 Creation and use of tuples in Python
Un “tuple” es como una lista que contiene elementos de cualquier valor y tipo. La principal diferencia entre un “tuple” y una lista es que los “tuples” no son mutables, es decir, no se pueden modificar a la hora de correr el programa. Para diferencia de un “tuple” y una lista visualmente es el uso de paréntesis o “()”. Bueno, de hecho, no se usa mucho los paréntesis; se puede utilizar solo paréntesis y una coma. Otra forma de crear un tiple es utilizar el comando “tuple” y paréntesis. Utilizaremos la mastery anterior:
Voy a modificar la primera línea sustituyendo los corchetes con paréntesis:
Vemos que en la línea 3 se quiere sustituir la posición número 1 de la lista “sel” de un 8 a un 3. Intentamos hacer esto con un “tuple” y esto nos mostrará en el output:
Los tupes tienen varias funciones. Uno sería el uso del comando “divmod”. Este toma 2 argumentos y los regresa con 2 valores diferentes que serían el cociente y el residuo. Aquí un ejemplo:
Otra función sería el “zip” con listas. Tenemos 2 variables: una con “tuple” y otra con una lista. Juntamos esto con “zip” y esto nos dará:
Comments Off on MASTERY 24 Creation and use of tuples in Python
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #Mastery23, #Mastery24, #TC1014
MASTERY 24 Creation and use of tuples in Python
CREACIÓN Y USO DE TUPLES
Un “tuple” es como una lista que contiene elementos de cualquier valor y tipo. La principal diferencia entre un “tuple” y una lista es que los “tuples” no son mutables, es decir, no se pueden modificar a la hora de correr el programa. Para diferencia de un “tuple” y una lista visualmente es el uso de paréntesis o “()”. Bueno, de hecho, no se usa mucho los paréntesis; se puede utilizar solo paréntesis y una coma. Otra forma de crear un tiple es utilizar el comando “tuple” y paréntesis. Utilizaremos la mastery anterior:
Voy a modificar la primera línea sustituyendo los corchetes con paréntesis:
Vemos que en la línea 3 se quiere sustituir la posición número 1 de la lista “sel” de un 8 a un 3. Intentamos hacer esto con un “tuple” y esto nos mostrará en el output:
Los tupes tienen varias funciones. Uno sería el uso del comando “divmod”. Este toma 2 argumentos y los regresa con 2 valores diferentes que serían el cociente y el residuo. Aquí un ejemplo:
Otra función sería el “zip” con listas. Tenemos 2 variables: una con “tuple” y otra con una lista. Juntamos esto con “zip” y esto nos dará:
Comments Off on MASTERY 24 Creation and use of tuples in Python
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #Mastery23, #Mastery24, #TC1014
MASTERY 24 Creation and use of tuples in Python
CREACIÓN Y USO DE TUPLES
Un “tuple” es como una lista que contiene elementos de cualquier valor y tipo. La principal diferencia entre un “tuple” y una lista es que los “tuples” no son mutables, es decir, no se pueden modificar a la hora de correr el programa. Para diferencia de un “tuple” y una lista visualmente es el uso de paréntesis o “()”. Bueno, de hecho, no se usa mucho los paréntesis; se puede utilizar solo paréntesis y una coma. Otra forma de crear un tiple es utilizar el comando “tuple” y paréntesis. Utilizaremos la mastery anterior:
Voy a modificar la primera línea sustituyendo los corchetes con paréntesis:
Vemos que en la línea 3 se quiere sustituir la posición número 1 de la lista “sel” de un 8 a un 3. Intentamos hacer esto con un “tuple” y esto nos mostrará en el output:
Los tupes tienen varias funciones. Uno sería el uso del comando “divmod”. Este toma 2 argumentos y los regresa con 2 valores diferentes que serían el cociente y el residuo. Aquí un ejemplo:
Otra función sería el “zip” con listas. Tenemos 2 variables: una con “tuple” y otra con una lista. Juntamos esto con “zip” y esto nos dará:
Comments Off on MASTERY 24 Creation and use of tuples in Python
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #Mastery23, #Mastery24, #TC1014
#mastery24 #TC1017
Creation and use of vectors in C++
C++ provides a data structure, the array, which stores a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type.
Instead of declaring individual variables, such as number0, number1, …, and number99, you declare one array variable such as numbers and use numbers[0], numbers[1], and …, numbers[99] to represent individual variables. A specific element in an array is accessed by an index.
All arrays consist of contiguous memory locations. The lowest address corresponds to the first element and the highest address to the last element.
Declaring Arrays:
To declare an array in C++, the programmer specifies the type of the elements and the number of elements required by an array as follows:
#D6D6D6 1.0pt; mso-border-alt: solid #D6D6D6 .75pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; background: #EEEEEE;”>
type arrayName [ arraySize ];
This is called a single-dimension array. The arraySize must be an integer constant greater than zero and type can be any valid C++ data type. For example, to declare a 10-element array called balance of type double, use this statement:
#D6D6D6 1.0pt; mso-border-alt: solid #D6D6D6 .75pt; padding: 4.0pt 4.0pt 4.0pt 4.0pt; background: #EEEEEE;”>
double balance[10];
Mastery 24
here a link useful for basic use of arrays
Comments Off on Mastery 24
Posted in Blogs, Syndicated, TC1017 Blogs
Tagged #Mastery24, #TC, #TC1017, Mastery
Creation and use of arrays in C++
Hey here’s my #mastery24 on arrays, I hope you like it.
https:/
#TC1017
Comments Off on Creation and use of arrays in C++
Posted in Blogs, Syndicated, TC1017 Blogs
Tagged #Mastery24, #TC, #TC1017, Mastery
Creation and use of tuples in Python
AQUI LES DEJO EL LINK DEL VIDEO DONDE EXPLICO
https:/
#Mastery24
#TC1014
Comments Off on Creation and use of tuples in Python
Posted in Blogs, Syndicated, TC1014 Blogs
Tagged #Mastery24, #TC, #TC1014, Mastery
Mastery 24
Creation and use of arrays in C++
C++ provides a data structure, the array, which stores a fixed-size sequential collection of elements of the same type. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type.
Instead of declaring individual variables, such as number0, number1, …, and number99, you declare one array variable such as numbers and use numbers[0], numbers[1], and …, numbers[99] to represent individual variables. A specific element in an array is accessed by an index.
All arrays consist of contiguous memory locations. The lowest address corresponds to the first element and the highest address to the last element.
Declaring Arrays:
To declare an array in C++, the programmer specifies the type of the elements and the number of elements required by an array as follows:
#d6d6d6;">type arrayName [ arraySize ];
This is called a single-dimension array. The arraySize must be an integer constant greater than zero and type can be any valid C++ data type. For example, to declare a 10-element array called balance of type double, use this statement:
#d6d6d6;">double balance[10];
Initializing Arrays:
You can initialize C++ array elements either one by one or using a single statement as follows:
#d6d6d6;">double balance[5] = {1000.0, 2.0, 3.4, 17.0, 50.0};
The number of values between braces { } can not be larger than the number of elements that we declare for the array between square brackets [ ]. Following is an example to assign a single element of the array:
If you omit the size of the array, an array just big enough to hold the initialization is created. Therefore, if you write:
#d6d6d6;">double balance[] = {1000.0, 2.0, 3.4, 17.0, 50.0};
You will create exactly the same array as you did in the previous example.
#d6d6d6;">balance[4] = 50.0;
The above statement assigns element number 5th in the array a value of 50.0. Array with 4th index will be 5th, i.e., last element because all arrays have 0 as the index of their first element which is also called base index. Following is the pictorial representaion of the same array we discussed above:

Credits:
http:/
http:/
Mastery 24
Hey everyone here is my video tutorial on Arrays! This is a long video due to the fact that arrays are a complicated format, but after watching my video you will be able to use it like nothing!
Comments Off on Mastery 24
Posted in Blogs, Syndicated, TC1017 Blogs
Tagged #Mastery24, #TC, #TC1017, Mastery
Creation and use of arrays in C++ #Mastery24
Arreglos
Podemos relacionas los arreglos con cajas, estas cajas a la vez pueden tener dentro mas cajas chicas y en cada caja se guarda un dato.
Esa es la utilidad que tienen los arreglos, supongamos que tenemos cierto numero de estudiantes, por ejemplo 20, y queremos crear una variable para la calificacion de cada uno, tardariamos demasiado en crear 20 variables diferentes para cada uno; por lo que la solucion mas practica seria crear un arreglo para las 20 variables. Como antes explicamos la caja grande seria el arreglo, las cajas mas chicas estan representadas por la variable de la calificacion y dentro de esta variable podemos ingresar un dato.
Ahora que entendimos que es un arreglo y cuando podemos usarlos, veremos como crear uno:
1- Elegir el tipo de variables a guardar en nuestro arreglo.
2- Definir el numero de datos que necesitamos guardar.
3- Ahora tenemos que comenzar a programar el codigo, esto es sencillo, muy parecido a crear variables.
4- Cuando ya tengamos los datos necesarios de los pasos anteriores debemos tomar en cuenta que el numero de espacios siempre tiene que estar entre corchetes “[ ]”.
5- Hay que tomar en cuenta que a la hora de ingresar el numero de espacios, estos se cuentan desde el 0, por lo que si queremos ingresar los 20 espacios, dentro de los corchetes tenemos que escribir 19.
Ejemplo:
#include
using namespace std
int main ( )
{
int arreglo [19]; // En este arregloe las variables son tipo int y cuenta con 20 espacios
arreglo[0]=80; // Aqui le estamos asignando a la casilla numero 0 el valor de 80
arreglo[19]=100; //Finalmente asignamos el valor del espacio 19, ultimo espacio dentro de nuestro arreglo
return 0;
}
De esta forma podemos crear arreglos, y para hacer mas eficiente la manera de ingresar los datos se recomienda usar algun loop. Ya que dentro de los corchetes del arreglo se pueden ingresar variables como en el siguiente ejemplo: arreglo[alumnos]
Comments Off on Creation and use of arrays in C++ #Mastery24
Posted in Blogs, Syndicated, TC1017 Blogs
Tagged #333333, #8cbf99, #include, #Mastery24, #TC, #TC1017, Mastery