Review 

--Originally published at Programming: First Steps

Al iniciar mi curso TC101 con Ken, no tenía idea de cómo usar Python. Luego al ver que la mayor parte del aprendizaje era por nosotros mismos me sentí perdida. Pero al comenzar a investigar, escribir en mi blog y aprender descubrí que no había una mejor manera de enseñar. Me gustó mucho la dinámica que llevamos a cabo. Además, los posts de cada blog puede ayudar a cualquier persona en el mundo que necesite saber algo sobre el programa. Siento que fue muy buen gesto de parte de Ken ya que literalmente aprendimos a aprender por nosotros mismos. Quiero agradecerle la confianza que nos tuvo. Al final aprendí más de lo esperado, hasta aprendí a enseñarles a mis amigos algunos puntos. En verdad recomiendo este curso a los que llevarán esta materia.

¡Gracias Ken!


My own dictionary

--Originally published at Welcome to the Heaven

The dictionaries in Python are very similar to a list. The dictionaries can be directly defined or can start in blank and over time you add some values and words or delete some.

The dictionaries write inside keys {} and the values and words with two points:

Example = {"my":12,"first":24,"dictionary":36}

So now with this variable you have already a dictionary and you can call one, two, three or any number of items that you want or change, delete or add one.

down = {“example”:picture}

screen-shot-2016-11-28-at-12-42-56-pmIn the picture you can see how I create a dictionary in white and after I add some values to it.

We can have access to specific items in the dictionary, as you can see in the second print we do it.

If you don’t want to have a KeyError in some key that you do not know if has a value you can use .get that returns None(if the key does not have it), the example of this is the last two prints.

More information? and you want my source?

If you want another different post of the same topic. Is from the blog of one friend.


([start],stop,[step])

--Originally published at Welcome to the Heaven

In this post you will learn how the function range acts. Is very common use this function in a loop when you want to the loop perform an action N number of times, also we can see it when we want to make operations with numbers or print specific values of a list/tuple.

Let’s see a picture with some examples, an after that I will explain you how it works at each case.

screen-shot-2016-11-27-at-2-35-18-am

As you can see in the title of this post ([start],stop,[step]), describes the way that act the first example. The range function always start form 0, so 0=first value. Start from 0 and the next number is going to be two numbers after.

The second one and third one are the same, but I put it just because these are the two ways to write a range, but if you want to be more professional you must use the second one.

The last one is the same as the first but with a difference in print. end=” ” makes that the function doesn’t go to the next line.

And if you want to see another example with the power of two range loops:

screen-shot-2016-11-27-at-2-37-06-am

With this little code we can do this:

screen-shot-2016-11-27-at-2-40-49-amscreen-shot-2016-11-27-at-2-40-58-am

Source.


Writing and reading

--Originally published at Welcome to the Heaven

Writing and reading comments is pretty easy, we only need create a text file, open and select the mode that we will use.

Open()

First we need to create a variable with the code: example:

text = open(file_name,mode)

Mode

Exist four kinds of modes: “r”, “w”, “a” and “r+”.

“r”->Only for reading

“w”->Writing(if you  have already a file with the same name will be erased)

“a”->Open the file to append any type of data

“r+”->Reading and Writing

Example

Writing

I am going to use “shot”
as a name, and if you see the picture I don’t have any file with this name. So if you write the code of the next picture, your program is going to create a new file with the name that you want and with the
text that you write. screen-shot-2016-11-26-at-11-29-46-pmscreen-shot-2016-11-26-at-11-34-37-pm

When you run your program in the terminal nothing is going to change, but if you search the file you will find it. Remember, if you have already a file with the same name will be erased.screen-shot-2016-11-26-at-11-39-21-pm

Reading

I am going to use the file shot for the example.screen-shot-2016-11-26-at-11-45-26-pm

If you don’t write “()” at the final of file.read, when you run the program will print you the same as the first time.

More information and the source.


blog post = “Strings”

--Originally published at Welcome to the Heaven

The strings are the most common type. Beside is pretty easy to create and to use. We can use the strings in the way that we want. Let’s see some examples of how we can do it.

screen-shot-2016-11-26-at-8-45-24-pmAs you can see, create a string is much easier than create any type and we can do a lot a things with it. In the third example we create another string with the last string and we can do “More”. For this reason the strings are awesome.

BUT, WAIT!!! I have not finished. I am going to show you 3 tables that can help you a lot in the future.

screen-shot-2016-11-26-at-8-54-11-pmscreen-shot-2016-11-26-at-8-53-43-pm

And when you want to use the string format operator “%” the have a lot of options for you:

screen-shot-2016-11-26-at-8-57-54-pmscreen-shot-2016-11-26-at-8-57-47-pm

These tables are not mine!! If you want to see more information you can make click at any table or in the next word->More information.


TC101 (2016) – Course RE:view

--Originally published at Monty Python and the Blogging Tale

You will have to excuse me, but the next lines are going to be in Spanish:

El curso de Ken ya casi acaba,  y la verdad es que fue muy diferente a lo que esperaba. Debido a que es flipped learning, pues pensé que sería una clase donde no trabajaría, pues no suelo trabajar cuando no siento la presión de alguna entrega; y por ende, pensé que no terminaría haciendo las actividades de manera abrupta, y de último moento (lo cual hice, en parte). Pero este método de aprendizaje me motivó en cierta manera a no atrasarme en los temas de todo el curso. A pesar de que mis blogs son muy sencillos, trato de hacerlos con cariño y cuidado, pero sobre todo, creatividad. La experiencia que tuve en el curso de tc101 2016 fue gratificante.

Este curso está hecho para gente interesada en los temas y trabajadora, si no estás dispuesto a trabajar por ti mismo, entonces lleva clase con otro maestro.

I’ll give this course an A+

 


¡Hoy me inicie en Python! :D. Cuarta consulta al Doctor Profesor Alexis Freud

--Originally published at TC101 – Doctor Profesor Alexis Freud

Hoy es un día muy emocionante. Llegó una paciente con demasiada euforia. O al menos la suficiente para contagiarla conmigo. Era una pequeña y tierna niña llamada María Daniela. Tuvo esta mañana su primer contacto con Python, la creación de su primer programa: “Hello World”. Siempre me siento muy emocionado cuando alguien escribe sus primeras líneas de código, y esta pequeña, lo hizo hoy.14881702_1246054458749148_136809934_o

Ella sonreía mucho, pero no vino a consulta únicamente a sonreír (aunque sería genial, digo, mientras me pague). El motivo de su presencia en mi consultorio codigocional era su necesidad de aprender Python. El diagnostico fue sencillo, ya que era su primer día paseando por estas tierras programadoras. Ella no sabía por donde iniciar, y aunque era más recomendable buscar un libro para apoyarla, decidí instruírla un poco con mi sensual conocimiento.

Existen en Python algunas definiciones básicas que tanto María Daniela, como cualquiera que desee iniciarse en el arte del código debe conocer.

Variable

En los lenguajes de programación se pueden encontrar variables. Éstas son representadas con símbolos, nombres o simplemente palabras a las que se les asigna un valor. Es como un lugar de tu programa donde guardas información y más tarde la usas sin tener que escribirla de nuevo. Este valor pueden ser números, letras, símbolos, valor booleano u otras variables. Casi lo que sea.

Para crear una variable necesitas, antes que otra cosa, ponerle un nombre. Para hacer un ejemplo pondremos de nombre “X“. A continuación se pone el signo “=” (igual a) y escribes el valor que desees asignarle. Para este ejemplo usaremos el valor “3“. Lo podemos ver así:

X = 3

Ahora tenemos guardado el valor de X. Si ahora quisiéramos utilizarlo en otra aparte del código solo tenemos que nombrarla. Por

2016-11-25-1
2016-11-26
2016-11-26-1
2016-11-26-3
2016-11-26-2
Continue reading "¡Hoy me inicie en Python! :D. Cuarta consulta al Doctor Profesor Alexis Freud"