Tag Archives: #Mastery24

Learn To Program 2015-04-06 19:54:00

Mastery24

Un tuple es una secuencia de datos inmutables. Es una secuencia similar a la lista, con la diferencia que los tuples no pueden modificarse y usan parentesis para declararse. Me bastó con leer la siguiente información para comprender su funcionamiento:
https://docs.python.org/3.3/tutorial/datastructures.html
http://www.tutorialspoint.com/python/python_tuples.htm

*******
Mi video:
*******
https://www.youtube.com/watch?v=HPRfJJg_n4I
**********************
Programa hecho en Python:
**********************
https://github.com/A01630323/Learn-To-Program/blob/master/Mastery24.py

Learn To Program 2015-04-06 19:54:00

Mastery24

Un tuple es una secuencia de datos inmutables. Es una secuencia similar a la lista, con la diferencia que los tuples no pueden modificarse y usan parentesis para declararse. Me bastó con leer la siguiente información para comprender su funcionamiento:
https://docs.python.org/3.3/tutorial/datastructures.html
http://www.tutorialspoint.com/python/python_tuples.htm

*******
Mi video:
*******
https://www.youtube.com/watch?v=HPRfJJg_n4I
**********************
Programa hecho en Python:
**********************
https://github.com/A01630323/Learn-To-Program/blob/master/Mastery24.py

#Mastery24 – Arrays

#Mastery25 #TC1014 #LaNieveDeColimaExploto #PenguinLove

 

Crear y usar rangos en python

 

#Mastery24 #TC1014 #LaNieveDeColimaExploto #PenguinLove

 

Creation and use of tuples in Python

mastery 24

++  

Arrays are a good way to store a determined amount of numbers given by the user. You can either enter the size of the array, and that will be the maximum f numbers that will fit in. Just so, you can create a variable in order to ask the user for the size of the array and that way you can ask as many numbers as the user wants to provide. When using arrays in functions, you need to replace your variables in the main() code, so you can ask the user for the size of the array and then ask for each number using a “for” loop or a “do while” loop.

here is an example:

<iostream>

<cstdlib>

 using namespace std;

 

 int average(int x[], int size){

   int sum=0, average;

 

   for(int i=0; i<size; i++){

     sum=sum+x[i];

   }

   average=sum/size;

   return average;

 

 }

 int main(){

   int size;

   int a[size];

   cout<<“give me the amount of numbers “<<endl;

   cin>>size;

   for(int i=0; i<size; i++){

     cout <<“give me a number “;

     cin>> a[i];

 }

 cout<<average(a,size);

 }

Mastery 24

Tuplas

Las tuplas son conjuntos ordenados de elementos encerrados entre paréntesis. Los elementos deben estar separados entre sí por medio de comas. Pueden ser formadas por números, palabras, etc.

La diferencia de las listas y de las tuplas está en que las tuplas no pueden ser modificadas, no pueden sumárseles, restarles o modificar ningún elemento. Lo único que si se puede hacer es ver el elemento que hay en alguna posición.

>>> t = (“a”, “b”, “hello”, “z”, “example”)

>>> t[3]                                       

‘z’

Las tuplas son más rápidas que las listas. Se utilizan para definir un conjunto de variables constantes.

 

Las tuplas pueden convertirse en listas, y viceversa. La función incorporada tuple toma una lista y devuelve una tupla con los mismos elementos, y la función list toma una tupla y devuelve una lista.

Finished WSQ10

Here is a link to my code for WSQ10 via GitHub using Arrays: Arrays

I have also included a picture of my code showing the outcome of the code

Untitled

To make easy the explanation of tuples, we can compare them with lists, this lists called tuples have something different, the items that are inside the tuple can not be changed, all the items that are inside are going to stay there as they where typed when the tuple was created. To create a tuple, you just have to type the name of the tuple followed by an equal and then between parenthesis the items that are going to be inside the tuple, separated each one with a comma and between quotation marks, for example: name = (“Jorge”, “Padilla”)

Arreglos – C++

Arreglos - C++

 

Aqui dejo el link de mi video donde se muestra como hacer arreglos y para qué sirven.

Cómo hacer arreglos en C++