本文整理汇总了Python中account.Account.pay方法的典型用法代码示例。如果您正苦于以下问题:Python Account.pay方法的具体用法?Python Account.pay怎么用?Python Account.pay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类account.Account
的用法示例。
在下文中一共展示了Account.pay方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from account import Account [as 别名]
# 或者: from account.Account import pay [as 别名]
def main():
#scenario 1 test
person1 = Account(0.35,1000)
person1.withdraw(500,1)
person1.calc_prin_bal_day(person1.bal_sheet,person1.dayPrin)
interest=person1.apr_calc(person1.bal_sheet,person1.dayPrin)
tot_payoff=person1.get_final_prin_bal(person1.dayPrin)+interest
print "Scenario 1 Test:"
print "Interest owed is $%05.2f"%(interest)
print "Total Payoff amount is $%06.2f"%(tot_payoff)
#scenario 2 test
person2 = Account("35%",1000)
person2.withdraw(500,1)
person2.pay(200,15)
person2.withdraw(100,25)
person2.calc_prin_bal_day(person2.bal_sheet,person2.dayPrin)
interest2=person2.apr_calc(person2.bal_sheet,person2.dayPrin)
tot_payoff2=person2.get_final_prin_bal(person2.dayPrin)+interest2
print "\nSecenario 2 Test:"
print "Interest owed is $%05.2f"%(interest2)
print "Total Payoff amount is $%06.2f"%(tot_payoff2)