Why Python first of all? Well, it is one of the simpler first languages to learn that is actually used by large corporations (one of the most notable are Walt Disney). It isn't exactly too complex to begin with and has a steady difficulty curve. And an added bonus? It's very mathematical!
The first thing you need to do really is download Python. The current version (as of 19th March 2011) is 3.2, but the majority of what I will discuss is from the 2.x versions, however they are not too different and the 3.x versions is basically just cleaned up from 2.x versions. However 2.x has a far greater library support, meaning custom variables that other people have created are much more readily available.
Download Python here. Another download that you may want is Notepad++ the amount of languages it recognises is pretty phenomenal; from HTML to Python and everything in between. If you'd like this brilliant open source software go here.
Once you've downloaded all of these we'll start you off with your first lesson. I will begin by introducing probably the most important command in Python, it's incredibly simple but is used to display any text.
"Hello world!" is the absolute must as it goes for starter programs, so that's what we'll do.
print "Hello world!"When the program is ran it shows:
Hello world!And that's it. Things to take note of are; the print command and the quotes. Any string of text has to have quotes surrounding it, else it does not make sense. And the print command has to come before any text you want to be "printed". And that's it for now, but the next lesson will be far more technical.
No comments:
Post a Comment