How to have an 'if' within a loop?
Question: I'm trying to solve a problem whereas, but I feel the loop I've got has a
missing link somewhere...

The brief I've been given - "Now write a program that calculates the minimum
fixed monthly payment needed in order pay off a credit card balance within 12
months."

In essence what I've done is far, is code up something that will take a base
value (10 for example), take it away from the credit card balance (taking into
account the interest), and if the total number of months it takes to put the
balance into a negative (e.g. paid off) is above 12, it adds to the 'minmonth'
(amount to be paid off per month) until the number of months is equal to is or
below 12.

Apologies in advance, I've literally only been learning Python for 2 days!

Where am I going wrong?

    
    
    balance = float(raw_input('Enter the outstanding balance on your creditcard: '))
    interest = float(raw_input('Enter the annual credit card interest rate as a decimal:     '))
    
    minmonth = 10
    months = 0
    monthlyinterest =  interest / 12
    
    while(balance > 0):
        balance = balance * (1 + monthlyinterest) - minmonth
        months = months + 1
    
        if(months > 12):
            months = 0
            minmonth = minmonth + 10
    
    else:
        print 'RESULT!'
        print 'Total amount to pay per month would be'
        print minmonth
        print 'Total amounts to pay'
        print months
    


Answer: Indentation is important in Python. You would want to bring the `else` in line
with the `if` statement in your code.

