Author Archives: alejanbreu

WSQ10

WSQ09

Mastery03

3.Create accounts: Blog, Twitter, GitHub

A blog is small site on the internet in which you can write about pretty much everything, from really interesting information, to you must personal thoughs. In this case, we’ll use it to wirte about coding. We are going to be using withknown. In order to sing into Withknown, and pretty much everything else in the internet, you need an email address.

Here is the main page of Withknow, we have to press the very intuitive blue button that says “create your site”.

Now we have to fill up this little questionary, with basic questions, like the name of your site(blog) and the username and password that you would like to use in order to constantly sing in.

Now you’ll have your blog of your own, like this. You can edit the appearence in your blog in “settings”, also you can add a little description of your blog or life, and a tacky icon to be easily identified. In “site configuration” you can change the settings, to allow people to comment your posts or to simultaneously post in other sites.

To sing up in twitter you must follow almost the same path, just go into the website. The main page already has the sing  up option. Just type your email and your password. You can later create your username and follow more users. Twitter is pretty much just another type of blog, but a little more social and open for everyone.

Github is again, the same as Twitter pretty much. Just as Twitter it has the sing up action in the main site. Unlike the others, github is used to write and save your code. You can share your code and see the code of someone else. You can also work on projects simultaneously with other people in the site.

Mastery11 and Mastery12

12.Creating Python functions.

In order to call a function we have to create it first, in python there are basic functions like sum or division. However we can actually create our own.

first we have to write “def”, in order to define our function. Now we have to write the name of our function, in this case I’m calling it sum_numbers, because we’re going to sum these numbers. Now we write in parenthesis the variables that we want to use. Then we’ll write the action that our function will do, this time is adding x plus y. Finally, we have to write “return answer” so the function give us the answer of the addition that we did there.

11.Calling Python functions

Now to call this function, we have to give them the value of variables, in this case num1 and num 2. Now we have to write the function, sum_numbers, but instead of having x and y, the actual value; num1 and num2. So now the function will make the addition of num1 and num2, the answer to this addition will be the value of the_sum. Now we only have to print “the_sum” in order to actually see the solution of  num1 + num2.

Mastery10

10. Basic output (print) in Python

Mastery09

9.Basic types and their use in Python

These are the few basic types in Python.

Integer: It refers to all integer numbers, negative and positve, than can be used in python, in order to create mathematical equations in your program.

Float: This time it refers to decimal numbers, like 1.5, numbers that don’t fit into the integer category.

String: It can be any sort of character, but it is preferred to be just letters, it be written inside of quotes. “Like this”.

List: A list is a serie of data that can be change anytime, like x = [1, two, 3]

Tuple: A tuple however, is pretty much a list that you can’t change, it is expresed like x = (1, two, 3)

Dictionary: As a real life dictionary, this is an array of data, that explains the significance of a “key” word. For example {Sun : The nearest star to earth and its main source of light  }

Mastery07

7.Use of comments in Python

Mastery06

6.Install Linux on their own computer.

To install Linux you first have to identify wich of the countless variations you want to install. The most common is Ubuntu. Now you need a CD or a USB key, and you have to save the Linux installer there. Once you do that you’ll have to boot the USB or the CD, pressing the F1, F2, or F11 key in your keyboard, the moment you start up your computer.

Mastery06

Then it a window should appear, asking you if you want to try or install linux, once you press the ‘install botton’ the program itself will do the trick and you’ll have Linux in your computer.

Mastery06

Mastery01

1.Ability to create Python file and run from command line

To create a python file, you first need a text editor, in my case I’m using Atom; you may dowload it here.

Once you have finished writing your code, you must save your file with the .py extension.

Then in your terminal you must first open the Folder where your document is, using ‘cd’ at first’. For example ‘cd Document. Then you must type ‘python’ so the terminal will recognize the type of code you’re going to run. Then you have to write, in full lenght, your document. And you’re finished.

WSQ08