Programming (also known as coding) is writing a list of instructions for your computer to process or obey. This list is called a program (or code) and each line of it is processed one by one, starting from the top and going downwards to the bottom. Other names for processing the commands are running or executing the code. When writing these commands it’s important to spell them correctly and get the punctuation right. The computer is an unforgiving nit-picker and will cough up errors if a command is mistyped or some necessary punctuation is forgotten.
Your computer will do pretty much anything you ask, within its limits. It’s just a machine and will do what you tell it to. Not too dissimilar to how a kettle will boil you water when you ‘tell it to’ by pressing the ON button. You can make it to count to 1 quadrillion and it’ll happily do that. Or you can order it to say how very smart you are, and it’ll do it. Look at all the different software that is available to make your computer do a multitude of tasks – load web pages in a browser, draw pictures in a paint program, play movies and songs etc etc.
How do you make your computer obey you? It will happily do what you want, but you have to understand how to talk to it, to use its language. It doesn’t understand English unfortunately:
Computer, count to 1 million – ERROR!
Computer, hack my neighbor’s email address – ERROR!
No, the main part of your computer that processes commands is a microchip called the CPU (Central Processing Unit.) To talk to the CPU you have to give it numbers, which correspond to the commands it will obey, known as machine code. But for a human being, numbers don’t make much sense, they’re hard to remember and understand. Also, it takes many of these basic machine code instructions just to do something simple or useful. Basically, the CPU’s native language isn’t easy to use for a human being and most software is not written using it.
So, is there an alternative? There is indeed, software is available that will convert a computer language into the CPU’s native code. Yes, you’ll have to learn a computer language, but cheer up it’s much better than typing in numbers to make your computer obey you.
This software that converts a computer language into the CPU code is called a compiler and its actions compiling. It reads the list of instructions in a certain computer language (for example C++) and then outputs a file that the CPU can understand. It’s kind of like a human translating a book in Spanish into a book in French.
There’s also another way to translate a computer language into the CPU machine code, and that’s using a program known as an interpreter. Here’s where Python comes in, the computer language you’ll be learning in this tutorial. A computer language that is interpreted like Python, works in a similar way to how a human interpreter translates spoken languages. For instance translating languages between a Spanish speaker and a French speaker, it’s done little by little, maybe a few sentences at a time. It’s not like translating an entire book the way a compiler works (in this comparison.)
But enough of this CPU machine code nonsense it’s not used much, let’s get on to learning Python to make your computer start cooking. As you learn to code by following this tutorial, don’t be too concerned if not everything sinks in to begin with. It takes time, practice and experience to become a good programmer, noone understands absolutely everything just by reading a tutorial. Also, it’s not essential at this stage to understand 100% of what each and every piece of code does. What matters most, the bottom line, is that your code is working, and is doing what it should do (but naturally if your code isn’t functioning correctly, then it’s necessary to know how it works in order to fix the errors.)
Anyway with that said, let’s get on with setting up and installing the software you’ll need in order to start programming with Python.
Comic Relief
How many programmers does it take to change a light bulb?
None. It’s a hardware problem.