-3

I believe I set-up the program right, but it errors out on line 10. However, when I run that section by itself in Powershell it doesn't error out. Thanks for your help in advance.

def hotel_cost(nights):
    return nights * 140

bill = hotel_cost(5)

balance = int(raw_input("What's the balance?"))

rate = float(raw_input("What's the interest rate? i.e. .02 = 2%")

def get_min(balance,rate):
    return balance*rate
#line 10 is above
print get_min(balance,rate)

def add_monthly_interest(balance):
    return balance*((rate/12)+1)

What I'm trying to do is write a function with add_monthly_interest that will return a balance on a credit card with the interest added on it to it. So for example 100* ((.15/12)+1) =101.25

4

1 回答 1

4
rate = float(raw_input("What's the interest rate? i.e. .02 = 2%")
                                                                 ^

is missing a closing parenthesis.

于 2013-09-08T21:30:14.557 回答