临汾市住房城乡建设局网站,杭州中小企业网站建设,门户网站建设方案中信息公开,网站开发需要哪些写一个函数#xff0c;在给定的年数后#xff0c;用给定的初始余额和利率计算银行帐户的余额。假设利息每年复利。在
出现错误“ValueError:索引28处不支持格式字符I#xff08;0x49#xff09;”
这是我目前为止的代码。在def BankBalance():
InputB 1000
return InputB
…写一个函数在给定的年数后用给定的初始余额和利率计算银行帐户的余额。假设利息每年复利。在
出现错误“ValueError:索引28处不支持格式字符I0x49”
这是我目前为止的代码。在def BankBalance():
InputB 1000
return InputB
print(Your initial balance is $1000)
def Interest():
InputI 0.05
return InputI
print(The rate of interest is 5%)
def CountNumber():
InputN float(input(Please enter the number of times per year you would like your interest to be compounded: ))
return InputN
def Time():
InputT float(input(Please enter the number of years you need to compund interest for:))
return InputT
def Compount_Interest(InputB, InputI, InputT, InputN):
Cinterest (InputB*(1(InputI % InputN))**(InputN * InputT))
print(The compound interest for %.InputT years is %.Cinterest %Cinterest)
B BankBalance()
I Interest()
N CountNumber()
T Time()
Compount_Interest(B, I, N, T)