Skip to content

Instantly share code, notes, and snippets.

@stevencombs
Created August 11, 2013 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevencombs/6206797 to your computer and use it in GitHub Desktop.
Save stevencombs/6206797 to your computer and use it in GitHub Desktop.
# Function to determine the minimum payment
# A Codecademy Python (Something of Interest) assignment
# Dr. Steven B. Combs, coding novice
def hotel_cost(nights):
return nights * 140
bill = hotel_cost(5)
def get_min(balance,rate):
return balance * rate # Calculates the minimum payment
def add_monthly_interest(balance):
interest = balance * (0.15/12) # Calculate interest
return balance + interest # Return the sum of the balance and interest
print get_min(bill, 0.02) # Two values, bill and 0.02, are passed to function get_min
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment