The Python interactive shell


Type python without any arguments on the command line and you'll get into the Interactive shell of Python. In the interactive shell you can type:


examples/basics/interactive_shell.txt
>>> print "hello"
hello

>>> "hello"
'hello'

>>> 6
6

>>> len("abc")
3

>>> "abc" + 6
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: cannot concatenate 'str' and 'int' objects

>>> "abc" + str(6)
'abc6'