If you have any questions, comments or issues with this project please post them here!

Built an interest calculator to see how much money I would owe! A bit boring, I know, but necessary for #reallife.

https://replit.com/@JackAdem/Day-019-Project-19-Loan-Calculator?v=1

Day 19 of #Replit100DaysOfCode #100DaysOfCode.

Not sure how best to notify the group who puts the videos together. In the video for Day 19, at approximately the 1:22 mark, David says â€śâ€¦that help us loop, and create variables aâ€ť and then the video cuts to the graphic for Up Next : Range

Iâ€™m stuck at this challenge and need help.

https://replit.com/@wittphoonsiri/day-19100-days

I manage to find a method to replicate the answers as shown by David but canâ€™t figure how to turn it into a code. I feel there are some necessary process or info that isnâ€™t cover in Davidâ€™s lesson video:

Can anyone help me please? I feel my process is wrong. I end up having to use exit( ) to end the loop as it will run 10 times of the same stuff.

This is Davidâ€™s request:

You are going to create a loan calculator that shows how much money you owe for a loan of $1,000 with a 5% APR (APR is fancy for Annual Percentage Rate) over 10 years.

This means each year the amount of money you owe will increase 5%.

Figure out how much you owe altogether for 10 years?

Use a

`for`

loop and one or two lines of looped code to determine the answer. (Hint: Donâ€™t make this overcomplicated. It should only be a few lines of code altogether.)

```
print("Loan Calculator")
print("$1000 over 10 years at 5% APR")
for initial_value in range(10):
initial_value = float(input("Enter initial value: "))
annual_percentage_rate = float(input("Enter APR value: "))
year = float(input("Enter amount of year: "))
interest1 = (initial_value * annual_percentage_rate)+ initial_value
print("year1 is", interest1)
interest2 = (interest1 * annual_percentage_rate)+ interest1
print("year2 is", interest2)
interest3 = (interest2 * annual_percentage_rate)+ interest2
print("year3 is", interest3)
interest4 = (interest3 * annual_percentage_rate)+ interest3
print("year4 is", interest4)
interest5 = (interest4 * annual_percentage_rate)+ interest4
print("year5 is", interest5)
interest6 = (interest5 * annual_percentage_rate)+ interest5
print("year6 is", interest6)
interest7 = (interest6 * annual_percentage_rate)+ interest6
print("year7 is", interest7)
interest8 = (interest7 * annual_percentage_rate)+ interest7
print("year8 is", interest8)
interest9 = (interest8 * annual_percentage_rate)+ interest8
print("year9 is", interest9)
interest10 = (interest9 * annual_percentage_rate)+ interest9
print("year10 is", interest10)
print("You paid $628.89 in interest!")
exit()
```

Why are you even looping? just get rid of the loop

Because Davidâ€™s instruction is for me to â€śUse a for loop and one or two lines of looped code to determine the answerâ€ť: He also hinted:

- Make sure the
`for`

loop happens 10 times.- Start your value (amount you are borrowing) before the loop starts.
- If you need to count on one more number, just write
`i+`

in the

The loop is for recalculating the interests every year.

Also, you need to leave the inital values, any input, outside of the loop because it should only be asked for one time.

Therefore, your code should look like this:

```
print("Loan Calculator")
print("$1000 over 10 years at 5% APR")
interest = initial = float(input("Enter initial value: "))
annual_percentage_rate = float(input("Enter APR value: "))
years = float(input("Enter amount of year: "))
for year in range(years):
interest *= annual_percentage_rate
print(f"Year {year + 1}: {interest}")
print(f"You paid ${initial - interest} in interest!")
```