Your First Program

Hello World

     >>> print "Hello World"
     Hello World
     >>>
  • Well, that was easy enough.

Python as a calculator

     >>> 3*4.5 + 5
     18.5
     >>>
  • Basically, interactive mode is just a simple read-eval loop.

Something more complicated

     >>> for i in range(0,10):
     ...     print i
     0
     1
     2
     ... etc ...
<<< O'Reilly OSCON 2000, Introduction to Python, Slide 7
July 17, 2000, beazley@cs.uchicago.edu
>>>