-
Notifications
You must be signed in to change notification settings - Fork 0
/
shiyanlou-变量和数据类型-code.tar
14 lines (14 loc) · 10 KB
/
shiyanlou-变量和数据类型-code.tar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Code/ 0000755 0011610 0011610 00000000000 14130776674 012547 5 ustar shiyanlou shiyanlou Code/investment.py 0000775 0011610 0011610 00000000557 14130776663 015327 0 ustar shiyanlou shiyanlou #!/usr/bin/env python3
amount = float(input("Enter amount: ")) # 输入数额
inrate = float(input("Enter Interest rate: ")) # 输入利率
period = int(input("Enter period: ")) # 输入期限
value = 0
year = 1
while year <= period:
value = amount + (inrate * amount)
print("Year {} Rs. {:.2f}".format(year, value))
amount = value
year = year + 1