Intro:
Python is a high-level object oriented interpreted programming language.
A simple app:
In every programming language is best to start creating a basic app, this app is usually a hello world and in python it can be as simple as:
- Code: Select all
print "Hello World"
This will print the text Hello World and exit.
Strings and integers:
In python there are strings and there are integers, a string uses double quotes or single quote:
- Code: Select all
print "Hello World"
print 'Hello World'
They both do the same.
Integers don't use any type of quotation:
- Code: Select all
print 1
If an integer uses quotation it becomes a string, for example:
- Code: Select all
print 1+1
will print out number 2, but this:
- Code: Select all
print "1"+"1"
will print out 11 the same way this:
- Code: Select all
print "hello"+"world"
will print out helloworld
It is important to know that you can't add (+) a string and an integer:
- Code: Select all
print 1 + "hello"
will produce this error:
- Code: Select all
TypeError: unsupported operand type(s) for +: 'int' and 'str'
To do so, the integer has to be converted into a string:
- Code: Select all
print str(1) + "hello"
Now you know the basics of strings and integers in python.
Next up: variables.
Stay tuned for more on this crazy sitcom.
Next: http://wololo.net/talk/viewtopic.php?f=37&t=11843



