-4
私は以下を持っています。100で割るべき利息の値を返すべきです。私は金利を10進数値に変換する必要があります
import math
p = int(raw_input("Please enter deposit amount: \n"))
r = float(raw_input("Please input interest rate: \n")) /100
t = int(raw_input("Please insert number of years of the investment: \n"))
interest = raw_input("Do you want a simple or compound interest ? \n")
A = p*(1+r*t)
B = p*(1+r)^t
if interest == "simple":
print (float(A))
else:
print(float(B))
それを試してみてください? – Iluvatar
ビットのXOR: 'B = p *(1 + r)** t'である'^'ではなく、' ** 'Pythonの指数演算子を使うべきであることに注意してください。 –
あなたは何に問題がありますか? – Qwerty