# Example showing how to print in columns header1 = 'Index' header2 = 'Value' val2 = 2.2 # # %-10s --- means fill in this blank with a String and force it to be 10 chars wide # --- the minus sign ('-') means left justify the text. So, # %10s ==> Right justified # %-10s ==> Left justified # In the following string there are two placeholders that get filled in with Strings # header1 and header2 repectively # print "%-10s %-24s" %(header1, header2) for i in range(10): val2 = 3.7 * (val2 * 1.32) # This print statement has two placeholders also, # %10d --- means fill in this blank with an integer, and force it to be 10 chars wide # %10.4f --- means fill in this blank with a floating point number (decimal) 10 characters # wide and with 4 numbers to the right of the decimal print "%-10d %-10.4f" %(i, val2)