none - output
Christian Stockhammer
christian.stockhammer at students.uni-linz.ac.at
Sat Nov 9 12:59:28 EST 2002
Hello List!
I wrote a litte program that will print out the rates of a credit, but i
face some problems. Here is the code:
schuld = 100000.0
zinsfaktor = 5.0
tilgung = 20000.0
def tilgungsplan(schuld, zinsfaktor, tilgung):
print "Periode Restschuld Zinsen Tilgung"
for i in range(0,5):
zinsen = (schuld*zinsfaktor)/100
echtetilgung=tilgung-zinsen
i = i + 1
schuld = schuld - echtetilgung
print i," "," ", schuld," ", zinsen," ", echtetilgung
print tilgungsplan(schuld, zinsfaktor, tilgung)
print "Restzahlung: ", schuld
This produces this output:
Periode Restschuld Zinsen Tilgung
1 85000.0 5000.0 15000.0
2 69250.0 4250.0 15750.0
3 52712.5 3462.5 16537.5
4 35348.125 2635.625 17364.375
5 17115.53125 1767.40625 18232.59375
None
Restzahlung: 100000.0
My problem is that the "None" (I do not know how to avoid this output!) and
the value for "Restzahlung" (how much is still left to pay) is not correct!
May you help me on this on?
More information about the Python-list
mailing list