Instrunctions
You will find the instructions on Kencourses blog
Procedure
First exercise:
In the «distance» function we will create a function that takes 4 paramethers and return us the formula of distance between 2 points.
We are not going to use them on this point but, for the rest of the #WSQ11 we are going to use the math module and the string module, i will point it out when the time to use them comes, nevertheless im not repeating how to import both in the same file. So keep atention and see the picture because this is the way to do it.

Second exercise:
In order to make the second one we will create 2 for loops, one in wich the i variable is going to be increasing untill the value is the same as a. On the second one our i variable will be decreasing untill the value is 0.

Third exercise:
We will create a function that using an if will determine if the factorial of the number its going to be find it using an algorithm or by just returning 1. (Which is the case for 0 and 1 factorial).
If the algorithm its required we are going to set the formula on a while loop and stops the loop if our counter reach our given number.

fourth exercise:
To calculate the main of a list we will create a for loop that is adding each one of the elements of our list in a variable to finally divide this value by the number of elelements (wich is found it using a counter that counts on every iteration).

Fifth exercise:
To find the samaller number between 4 values, i created a function that determines the smaller number between two values, it wasn’t the most eficient way to solve it, because the math module has already its own function that does exactly the same thing, nevertheless regartless of what you choose to do (use min() or make your own function) the next step is going to be the same.
We will create a function that receives 4 paramethers and using a binary operation will determine wich one in the two operations is the smallest and then it will take the result of each one of the previus function to determine wich one of this two final values is the greater.


Sixth exercise:
For the fibonacci sequence we will do almost the same process like the third exercise (we will evaluate if its necesary to use an algorithm or not). If the answer is yes, we will use the algorithm of the fibonacci sequence inside a while loop.

Seventh exercise:
We are going to use a for loop that will iterate in every element of our list, on each iteration we will add the square of the current element and when the loop has ended we will return the total.

Eighth exercise:
We will find two elements that multiplied results on the number that was given as a paramether, in this case we will use the number 2 and the half of the given number.
Then we are going to use a while loop that will iterate untill the diference between the number a and the number b, results on a number less than 0.001.
While the loop its iterating the a and b value will be update using the babylonian method (a+b/2 for the base of the same square and x/a to find out the other side).
At the end of the loop will return one side of the square.

Ninth exercise:
To find out how many times the word banana its found it on a text file, we firstly will create our own file. Once we do that we will create another function that will help us to finish the main program, this function is going to use the string module to transform each character of a string into a lower case letter. If the character can’t be transform it will omit it and just don’t add it into a new variable.
Then it will return a new string which will be a copy of the original one, but this time without characters that are not lower case letters. This function will be called «Just_lowercases».
Then we are going to create our main program «find_bananas», this program will use a counter and a for loop that will iterate on each line of the text and on each line will call the «Just_lowercases» function that will convert the text and use the «count» method to count how many times the word «banana» its found it.
I read that on windows if we don’t use the close() function once we open a file using python, the file will have troubles later, i forget to do it the first time but nothig happened. Nevertheless just in case we will do it to avoid posibles errors.

Tenth exercise:
To find the common divisor of each number we will use a for loop that using the min() function of the math module will determine wich number its the smaller one. This number will be the maximum posible common divisor.
Finally on our for loop we will determine if a number its divisor of both using the module operator.

Resources:
Finally I want to say thank you to one friend of mine, Brian, that helped me to solve the exercise number ten. It was very help full and not just that it actually helped me to change the way in which i was solving my exercises.