I am trying to put an exponent in my code and for some reason it keeps giving me a "can't assign operator" error for it and I'm not sure why.
I changed to code to not have any 'int' and I tried importing math because I wasn't sure if exponents needed to be imported, clearly neither worked. Other than these, I'm not sure what is wrong with the code.
name = input("Enter name: ")
bank_name = input("Enter bank name: ")
initial_investment = input("Enter initial investment amount: ")
annual_interest_rate = input("Enter annual interest rate: ")
investment_years = input("Enter number of years to invest money: ")
investment_months = investment_years * 12
monthly_interest_rate = ((int(annual_interest_rate) / 12) / 100)
MIR^IM = (1 + int(monthly_interest_rate)) ** (int(investment_months))
final = int(initial_investment) * int(MIR^IM)
gain = int(final) - int(initial_investment)
I wanted to MIR^IM variable to produce (1 + monthly interest rate) ^ investment months
{}button^. You are trying to assign to expressionMIR ^ IM. Change name of the variable toMIR_IM. Note:^doesn't stand for power.