These are just some impromptu python examples of strings and lists..

In [1]:
print 'hello world'
hello world

In [2]:
x='hello world'
In [3]:
print x
hello world

In [4]:
x[0]
Out[4]:
'h'
In [5]:
x[5]
Out[5]:
' '
In [6]:
len(x)
Out[6]:
11
In [7]:
x[10]
Out[7]:
'd'
In [8]:
x += '!'
In [9]:
print x
hello world!

In [10]:
x[11]
Out[10]:
'!'
In [11]:
x[-1]
Out[11]:
'!'
In [12]:
x[-6]
Out[12]:
'w'
In [13]:
x[2:7]
Out[13]:
'llo w'
In [14]:
y=x.split()
In [15]:
y
Out[15]:
['hello', 'world!']
In [16]:
y[1]
Out[16]:
'world!'
In [17]:
range(10)
Out[17]:
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
In [18]:
range(2,10)
Out[18]:
[2, 3, 4, 5, 6, 7, 8, 9]
In [19]:
range(2,10,3)
Out[19]:
[2, 5, 8]
In [20]:
#see http://matplotlib.org/gallery.html
plot([x**2 for x in range(10)],'o')
plot([x for x in range(10)])
legend(['x**2','x'],loc='upper left');
In []: