#Quiz3

Bueno es tiempo de hacer unos cuantos posts (bastantes) ya que se acerca el final de parcial y no quiero dejar todo para el último día de clases, he estado trabajando en los quiz y wsq’s pero hasta este momento he decidido postearlos jaja, en esta ocasión en español porque… y por qué no? jaja, bueno comencemos, la primera parte del quiz #3 que de hecho pertenece al primer parcial, consiste en esto:

  1. Write a function called distance(x1, y1, x2, y2) which receives four numbers which represent two points in the cartesian plane. The function should return the distance between the two points (x1,y1) and (x2,y2). Remember that the square of the hypotenuse of a right angle triangle is equal to the sum of the squares of the two other sides

Como podemos ver, se nos pide escribir una función que nos ayude a calcular la distancia entre 2 puntos y nos dice que para hacerlo, la fórmula quedaría así :

para poder calcular la distancia entre los puntos dados por el usuario importaremos el módulo math de esta manera: import math el cual nos permitirá sacar la raíz cuadrada de la fórmula de la siguiente manera: math.sqrt(fórmula). Aquí está el screenshot de atom y del programa funcionando:

quizz3

Gracias al blog de Carlos Daniel encontré un forma de hacer el programa sin que salgan todos los decimales que python arroja, utilizando el comando: round(valor,espaciosdecimales), quedando de esta forma en el programa:

quizz3.2

terminal

 

En la parte 2 del quiz#3 se pidió:

Write a function called fibonacci which receives a single parameter “n” (a non-negative integer) and returns the nth number in the fibonacci series which is: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89………… So, fibonacci(0) would return 0. fibonacci(5) would return 5 fibonacci(8) would return

QUIZ3

Continue reading “#Quiz3”

Quiz 02

And one or 2 more post for today, here’s the code for the 2 problems

Here’s the first part, in atom and the terminal

First I used 2 inputs and then defined the superpower which will allow us to generate the operation is this right here (x,y)

then the result will be z which is (x**y) and it will return it has the superpower!!!

quiz2part1

I had some problems with the second problem, but thanks to this blog I figured out how to do the solution in the easiest way possible! Thank you esenombredeusua 🙂

First we define a function that will allow us to print as many stars as we want in the same line def stars(a): then we multiply the string so it would be so much easier, I know this thanks to the pal above

quiz2part2

And last but not least, my code on Github

Quiz2

 

 

WSQ04 – Flipped Learning / #AbolishGrades

To understand better this kind of learning I did a meme

qtdit

To know more about this I watch the video that Ken provided us which is this one

I choose this one because is more interactive and is easier to understand what flipped classroom is about, I think is really cool that we do actually have freedom with this type of learning because you decide when to do the stuff you have to do, but obviously it have disadvantages like I happened to me you left all for the last minute ah? But of course it will help us to take responsability and manage our time as it should be, this doesn’t mean that we can’t count on the teacher, of course we can count on him, he is like a guide to us.

About the #abolishgrades I think is awesome because you don’t feel pressure all the time about being a 100 student, so I’m looking foward to this whole new experience.

WSQ02 – Hello World

And here’s the Hello World program, it’s been a whole new experience working with python, because I took other courses with c++ and I think it’s a little more complicated than python but once I get used to it I think I’ll be fine.

So here’s the code of hello World, are you ready?

Captura de pantalla 2016-02-15 a las 12.07.04 p.m.

Yeah! Simple as that! This is so cool, I’m starting to love Pyhton 3!