principal = 1000.0 # starting principalrate = .05 # interest rateprint "Year %21s" % "Amount on deposit"for year in range( 1, 11 ): amount = principal * ( 1.0 + rate ) ** year print "%4d%21.2f" % ( year, amount )