loan payment project in Python : I am learning Python and am stuck. I am trying to find the loan payment amount. I currently have:

def myMonthlyPayment(Principal, annual_r, n):

    years = n

    r = ( annual_r / 100 ) / 12

    MonthlyPayment = (Principal * (r * ( 1 + r ) ** years / (( 1 + r ) ** (years - 1))))

    return MonthlyPayment

n=(input('Please enter number of years of loan'))

annual_r=(input('Please enter the interest rate'))

Principal=(input('Please enter the amount of loan'))

However, when I run, I am off by small amount. If anyone can point to my error, it would be great. I am using Python 3.4.