问题描述
我刚刚完成了我的预算,它告诉我是否包括扣除额(根据是收入还是赠金)。我想添加一种方法来输入日期并开始计算和绘制我节省的金额。我知道这是一个广泛的问题,我不要求完整的答案。只要指向正确的方向就很棒。
这是我的代码:
import numpy as np
string = "WORKING BUDGET TEMPLATE"
print(string.center(50,'-'))
print("Enter amount: $")
income = int(input())
def printAmount(variable):
print("Save long term: \n$"+ str(round((variable * 0.3),2)))
print("Save short term: \n$" + str(round((variable * 0.3),2)))
print("Spending money: \n$" + str(round((variable * 0.4),2)))
paymentType = input("Is this amount from a paycheck? (Y/N) \n")
if paymentType == "Y":
real_income = income-(280+income*0.12)
print("""Deductions:
Phone: -$30
Truck: -$250
Income Tax: -12%
Real income: $""" + str(round(real_income,2)))
printAmount(real_income)
else:
printAmount(income)
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)