# For20.py (c) Kari Laitinen # http://www.naturalprogramming.com # 2006-04-18 File created. # 2022-12-16 Converted to Python 3. # 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, end="" ) print( "\n" )