萌新求教...请问我的python代码语法哪里出了问题?
import mathdef loan_calc():
x = input('What are you gonna calculate? ')
if x == 'r' or x == 'R':
t = input('How long is the period in years? ')
pv = input('What is the present value? ')
fv = input('What is the future value? ')
print('{} euqals to {}'.format(x, pow(fv/pv, 1/t)-1)
if x == 'p' or x == 'P': (这一行总是提示语法出错,如果删除的话就提示下一个if行语法出错)
r = input('What is the interest rate? ')
pv = input('What is the present value? ')
fv = input('What is the future value? ')
print('{} euqals to {}'.format(x, log(1+r, fv/pv)))
if x == 'pv' or x == 'PV':
r = input('What is the interest rate? ')
t = input('How long is the period in years? ')
fv = input('What is the future value? ')
print('{} equals to {}'.format(x, fv/pow(1+r, t)))
if x == 'fv' or x == 'FV':
r = input('What is the interest rate? ')
t = input('How long is the period in years? ')
pv = input('What is the present value? ')
print('{} equals to {}'.format(x, pv*pow(1+r, t)))
loan_clac()