如何为程序创建表函数?

时间:2016-10-26 15:35:00

标签: python-3.5 create-function

我想创建一个从代码中提取数据并从中创建表格的函数:

 if mode_choice ==1 or 2:
    def main():
        pv= float(input("Enter the principle amount: "))
        interest = float(input("Enter the interest rate (in perecent): "))
        term = int(input("Enter the term (in months): "))
        interest = interest / 12 / 100

        payment = (interest * pv) / (1-(1 + interest)**-term)


    main()

0 个答案:

没有答案