Author Archives: Thais Lizeth Santos Acosta

Mastery30

Reading and writing of files in Python

Para este Mastery, utilizré el código del WSQ16 (:

Link: https://github.com/LizethAcosta/Tareas/blob/master/WSQ16

Es muy sencillo abrir un archivo, los primero es ubicar el archivo .txt en la misma carpeta donde tendremos guardado nuestro programa. Lo abriremos con “Open” y le daremos el atributo “r” que es de lectura. Ya que tenemos nuestro archivo abierto, podremos hacer lo que se nos pida: contar líneas, mostrar datos, etc. Es muy importante que cerremos nuestro archivo al finalizar el programa, lo cual lo haremos con a.close()

30

WSQ16

Mastery29

Mastery28

Input: Text

Es muy sencillo. Como es un texto el que queremos que el usuario introduzca, lo convertiremos a string.

Ejemplo:

Link: https://github.com/LizethAcosta/Tareas/blob/master/Mastery28

28

Mastery27

Diccionarios

Se trata que cuando tienes una lista que a su vez tiene categorías, al momento de imprimir el pograma, te dara el valor de la categoría que indicaste. 

Link: https://github.com/LizethAcosta/Tareas/blob/master/Mastery27

27

Mastery26

Strings

Son las frases o palabras que tenemos en nuestro programa, podemos sumarlas, restarlas, etc.

Link: https://github.com/LizethAcosta/Tareas/blob/master/Mastery26

26

Mastery22

Repetitions

While: Is used for repeating sections of code until a defined condition is met.

For: Is used when you have a piece of code which you want to repeat n number of times. 

Recursion: Is when a function is called inside de same function.

It depends on what your program is about. While is used for repeting actions. For is used for actions that the function have to do for each element in something. And recursion is when you have some conditions that are going to change the original value and then it have to make the function again.

 

Link: https://github.com/LizethAcosta/Tareas/blob/master/Mastery22

22

 

Mastery20

For

For loops are traditionally used when you have a piece of code which you want to repeat n number of times. 

Link: https://github.com/LizethAcosta/Tareas/blob/master/Mastery20

20

Quiz11

ECOS

La hice desde el 21 que salió (: