I'm finding out the minimum payment to make, to ensure the debt is fully settled after 12 months

The unpaid credit balance is compounded every month by (a/12)%

I just started learning recursion and couldn't figure out why my base code for recursion is wrong. The console throws up recursion error. Here's part of the code.

> 
> #minPayment (3329,0.2)
> 
> 
> 

```
def minPayment (cb, a):

'''
cb = initial credit balance
a = annual interest (in decimals)
'''

  x = 0
  unpaid = cb-x
  inc = (cb-x)*(a/12)

  def mintha (x):
     totalPay = unpaid + inc

     if (12*x - totalPay) >= 0:
         return x

     else:
         totalPay = unpaid + inc
         return mintha (x+10) 

 return mintha (x)

```

Expected result = 310  

Actual result = 290