Python Programming pt. 1: Introduction to Variables
Python is the first language I learned how to program in and is the one I feel the most comfortable with, so it makes sense to me that it should be the first programming guide I write. In my screenshots I’m going to be using the Python IDE for Windows, however you can also code Python in Linux. You can download Python from here.
The first statement to know is the ‘print’ statement. This statement simply outputs text. We’re going to start with the classic print(”Hello World!”). ‘print’ is the statement that tells the Python interpreter (the thing that runs the code, to put it simply) we want to output text, and we tell it what to output by putting it in brackets.

When we run this for the first time we will be prompted to save the file. After saving the code will run and ‘Hello World!’ should appear in a new window.

You have now displayed a string. A string is a series of characters, and you show Python it is a string with the quotation marks. You can see that the quotation marks are not shown in the output.
Now let’s set a variable and output that. Variables are used to store information in your code. Using the line “var = “UndedInside” I define a variable called ‘var’ and set it to my name. I now change my print statement to show my variable.

Now when I run this it will show the following:

The space after “I’m” and before the final quotation mark is needed, otherwise there won’t be a space between “I’m” and “Unded”. Adding text together like this is called concatenation. We can also concatenate text using a comma between the two parts, and this way the space isn’t needed.

Like the name suggests, variables can change. After this print statement, let’s redefine the variable and print the value again.

This is a simple python program, just to teach the fundamental basics. As I write more guides, I’ll go into more depth and teach more topics.