python外汇兑换计算器_Python 3.2版本下实现简单的个人理财计算器(存款)脚本

最近看着物价飞涨,才想起来有好多的天没查看财务状态了,正好公司在进行python 3.2脚本调研,就用这个机会,动手写了一个个人理财计算器。不是很好,但放个这里做纪念,日后改进。O(∩_∩)O~

print ("Welcome to Financing System")

Amounte = 0.0                          # 本金初始化

DepositCurrent = 0.005                 # 活期利率

TypeDeposit = input("choice the kinds of deposit, current deposit is 1, fixed deposit is 2 and lump deposit is 3") # 获取存款类型

TypeDeposit = int(TypeDeposit)

if (TypeDeposit != 1) and (TypeDeposit != 2) and (TypeDeposit != 3):

print("the kind of deposit is error, it's over")

elif TypeDeposit == 1 :

Amounte = input("Enter the number of money, please:")                       # 录入存款金额

Amounte = int(Amounte)

Amounte = Amounte * (1 + DepositCurrent)                                    # 计算本金和利息

print("you choice current deposit and the Effective Annual Rate is %f. One year later, you will get %10.2f" % (DepositCurrent,Amounte))

elif TypeDeposit == 2 :

Amounte = input("Enter the number of money, please:")                       # 录入存款金额

Amounte = int(Amounte)

RateFixed = input("Enter the Effective Annual Rate(0.0000), please:")

RateFixed = float (RateFixed)

Depositmonth = input("how long(months):")

Depositmonth = int(Depositmonth)

Amounte += Amounte * RateFixed / 12 * Depositmonth

print("you choice fixed deposit and the rate is %6.4f. %4d months later, you will get %10.2f" % (RateFixed,Depositmonth,Amounte))

else :

NumTerminally = input("Enter the number of money for terminallly:")

NumTerminally = int(NumTerminally)

Month = input("How long time for you (month)")

Month = int(Month)

RateFixed = input("Enter the Effective Annual Rate(0.0000), please:")

RateFixed = float (RateFixed)

TempTerminally = NumTerminally * RateFixed / 12

TempSum = 0.0

for i in range(1,Month + 1) :

TempSum += TempTerminally * i

NumTerminally = TempSum + NumTerminally * Month

print("you choice lump deposit and the Effective Annual Rate is %6.4f. Three years later, you will get %10.2f" % (RateFixed,NumTerminally))

print("done")

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值