Lab 5

Summary

In this lab, I have learned how to use code to plan a vacation.

Code

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):
left = balance – payment
z = add_monthly_interest(left)
return z

new_bill = make_payment(bill/2, bill)
print new_bill
x = make_payment(100, new_bill)

print “You still owe: “, x

Screenshot

Screenshot (9)

Leave a Reply

Your email address will not be published. Required fields are marked *