There is a political heart inside Lemmy

  • 6 Posts
  • 29 Comments
Joined 4 months ago
cake
Cake day: February 28th, 2024

help-circle





















  • Thanks, but my project requires also the results between the first and the last year the investment was increased…

    As a base, I’m testing $600, 5% interest, and 6 years to wait, so I need to show the amount for years 1-5 as output, before I see final result of the 6th year…

    I can’t just put:

    total1 = principle * pow((1 + rate/100), 1)

    print(f"Balance after {1} year/s: ${total1:.2f}")

    total2 = principle * pow((1 + rate/100), 2)

    print(f"Balance after {2} year/s: ${total2:.2f}")

    total3 = principle * pow((1 + rate/100), 3)

    print(f"Balance after {3} year/s: ${total3:.2f}")