2 Funktionen miteinander arbeiten lassen
Verfasst: Sonntag 24. Mai 2020, 13:28
hallo,
ich bin neu im Game, also please do not jugde
folgendes Problem:
code ->
def berechnen(end2, end_of_month):
end2 = end2 + current_savings + ((end_of_month + current_savings )*(0.04/12))
return end2
def firstmonth():
end_of_month = current_savings + r
end1 = end_of_month + current_savings + ((end_of_month + current_savings )*(0.04/12))
end2= end1 + 0.01 * monthly_salary
while end2<portion_down_payment:
berechnen(end2, end_of_month)
print(end2)
firstmonth()
ich möchte, dass firstmonth quasi den ersten Monat ausrechnet, dann in eine While schleife übergeht, berechnen aufruft (falls true), berechnen end2 neu berechnet, dann es in firstmonth übergeht und firstmonth wieder prüft, ob "end2" kleiner als portion_down_payment ist. Allerdings wird end2 nicht berechnet, es bleibt dauernd bei dem gleichen Wert... wo liegt da der Fehler?
ich bin neu im Game, also please do not jugde

folgendes Problem:
code ->
def berechnen(end2, end_of_month):
end2 = end2 + current_savings + ((end_of_month + current_savings )*(0.04/12))
return end2
def firstmonth():
end_of_month = current_savings + r
end1 = end_of_month + current_savings + ((end_of_month + current_savings )*(0.04/12))
end2= end1 + 0.01 * monthly_salary
while end2<portion_down_payment:
berechnen(end2, end_of_month)
print(end2)
firstmonth()
ich möchte, dass firstmonth quasi den ersten Monat ausrechnet, dann in eine While schleife übergeht, berechnen aufruft (falls true), berechnen end2 neu berechnet, dann es in firstmonth übergeht und firstmonth wieder prüft, ob "end2" kleiner als portion_down_payment ist. Allerdings wird end2 nicht berechnet, es bleibt dauernd bei dem gleichen Wert... wo liegt da der Fehler?