Interactive python examples

$ python

>>> print 2+2
>>> x = 3
>>> x*2

>>> class Plane:
...     x = 123
...     y = 456
...[ENTER]

>>> p = Plane()
>>> p
>>> p.x
>>> p.y = p.y + 1
>>> p.y
>>> p.__dict__

>>> l = list()
>>> l.append (11)
>>> l.append (22)
>>> l[0] = "changed"
>>> l

>>> d = dict()
>>> d["speed"] = 11
>>> d["dir"] = 22
>>> d
>>> d["dir"]

>>> for i in d:
...    print i, "is", d[i]
...[ENTER]

>>> d["newitem"] = l
>>> d

>>> quit() [OR CONTROL-D OR CONTROL-Z]
$