我怎样才能以表格的形式打印这个?
listex = range(nOfYears)
counter = 1
for i in listex:
if i ==0:
print counter, '\t',startingBalance,'\t', amountofinterest, '\t', next_balance
previous_balance = next_balance
total_interest +=amountofinterest
else:
counter += 1
amountofinterest = previous_balance*interestRate
total_balance = previous_balance+amountofinterest
print counter, '\t', previous_balance,'\t', amountofinterest, '\t', total_balance
previous_balance = total_balance
total_interest += amountofinterest
print '\n', "TOTAL BALANCE IS :", previous_balance
print "TOTAL AMOUNT OF INTEREST IS %.2f:" %(total_interest)