我想创建一个从代码中提取数据并从中创建表格的函数:
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()