# For20.py (c) 1997-2006 Kari Laitinen # http://www.naturalprogramming.com # 2006-04-18 File created. # 2006-05-27 Last modification. # The 'print' command in Python is a statement, i.e., # 'print' is a reserved keyword. # The print statement prints a newline after each # printing operation unless there is a comma at the end # of the print statement. The print statement adds a # space character after each printed item. # The for loops in Python programs resemble the 'foreach' # loops of Java and C# langauges. In the following loop # range( 21 ) specifies that number_to_print will have # all the values from 0 to 20. print "\nNumbers from 0 to 20 are the following:\n" for number_to_print in range( 21 ) : print "%d" % number_to_print,