Mortgage calculator, unable to use variables as integers, to do math formula
I removed self.calculations()
from def __init__
because it causes a division by 0.
Then, assuming you want all values to be integers, I changed :
p = p.get()i = i.get()n = n.get()
into
p = int(self.P.get())i = int(self.I.get()) / 100n = int(self.N.get())
because you were not getting the values of from the text fields and "i" was not divided by 100 to make it a scalar from 0 to 1 (which I think should be the case in your formula)
I haven't checked your monthly formula but I think it should be:
divide2 = ((1 + i) ** (n - 1))
and add @MasterOfTheHouse's suggestion and it should be fine!