Just had a look at the tute at the top, tried the examples but on one something not right, at the bottom the returns are different to what i should have got. Am i missing something?, i copy/pasted so not to make a mistake.
[micheal@localhost ~]$ cd ~
[micheal@localhost ~]$ mkdir -p pyedu/{lesson01/notes,lesson02/notes,lesson03/notes,lesson04/notes,lesson05/notes}
[micheal@localhost ~]$ cd pyedu/lesson01
[micheal@localhost lesson01]$ python
Python 2.5.2 (r252:60911, Jun 28 2008, 14:11:09)
[GCC 4.1.1 20060724 (prerelease) (4.1.1-4pclos2007)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 'abcde'[ 0 ]
'a'
>>> 'abcde'[ 3 ]
'd'
>>> 'abcde'[ 9 ]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IndexError: string index out of range
>>> 'abcde'[-1]
'e'
>>> 'abcde'[-3]
'c'
>>> 'abcde'[-9]
File "<stdin>", line 1
'abcde'[-9]
^
IndentationError: unexpected indent
>>> abcde'[-0]
File "<stdin>", line 1
abcde'[-0]
^
SyntaxError: EOL while scanning single-quoted string
>>>