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

Tuesday, November 27, 2012

Codecademy: "Paying Up"


#sample solution


def hotelCost(days):
return 140*days

bill = hotelCost(5)
print "Bill cost is " + str(bill)

def addMonthlyInterest(balance):
return balance * (1 + (0.15 / 12) )

def makePayment(payment,balance):
adjustedBalance = balance - payment
newBalance = addMonthlyInterest(adjustedBalance)
return "You Still Owe: " + str(newBalance)

print makePayment(350,bill)

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts