Quotes help make search much faster. Example: "Practice Makes Perfect"

Tuesday, November 27, 2012

Codecademy: "Something of Interest


#sample solution


def hotelCost(days):
return 140*days

bill = hotelCost(5)

def getMin(balance, rate):
minimumPayment = rate * balance
return minimumPayment

print getMin(bill, 0.02)

def addMonthlyInterest(balance):
#since APR is an annual percentage, divide it by 12 to get the
#monthly percentage
    APR = 0.15 / 12
    interest = balance * APR
    return balance + interest

print addMonthlyInterest(100)
print addMonthlyInterest(bill)

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts