Created
August 11, 2013 21:18
-
-
Save stevencombs/6206891 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Number is Integer or Float - return Absolute Function | |
# A Codecademy Python (Make a Payment: Run It) assignment | |
# Dr. Steven B. Combs, coding novice | |
def hotel_cost(nights): | |
return nights * 140 | |
bill = hotel_cost(5) | |
def add_monthly_interest(balance): | |
return balance * (1 + (0.15 / 12)) | |
def make_payment(payment, balance): | |
payment = balance - payment | |
new_balance = add_monthly_interest(payment) | |
return "You still owe: " + str(new_balance) | |
print make_payment(100, 700) # Two values are passed to function make_payment | |
# 100 is the payment and 700 is the balance calculated from 5 nights at $140 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment