title: Python Error: 'float' object cannot be interpreted as an integer
body: <p>I am trying to build this tax calculator and keep receiving this error:</p>
  
  <blockquote>
    <p>'float' object cannot be interpreted as an integer</p>
  </blockquote>
  
  <p>The problem seems to be my <code>range</code> line, but I can't figure out how to fix it.</p>
  
  <pre><code>class taxCalc:
     def __init__(self):
        self.brackets_single = {(0,10000):0.15, (10000,45000):.18, (45000,72000):.23, (72000, sys.maxsize):.38}   
        self.brackets_joint = {(0,20000):0.15, (20000,90000):.18, (90000,144000):.23, (144000, sys.maxsize):.38}
  
     def taxcal(self, income, fil_stat, depen, stdeduc):
        if stdeduc == 'TRUE':            
            if fil_stat == 'single':
                agincome = income - 1000
            elif fil_stat == 'joint':
                agincome = income - 2000
        else: agincome = income
  
  
        if depen == 1:
            agincome -= 1000
        elif depen == 2:
            agincome -= 2000
        else:
            agincome = income
  
  
        PEP = .02
        if agincome &gt;= 45000 :
            amount = agincome - 45000
            amount /= 1000
            amount *= PEP
            amount *= (1000*depen)
            if 1000*depen - amount &gt; 0:
                agincome += amount
            else: 
                agincome += (1000*depen)
  
        else: agincome = agincome
  
        tax = 0
        if fil_stat == 'single':
           for bracket in self.brackets_single:
                       if agincome &gt; bracket[0]:
                           for _ in range(bracket[0], min(agincome, bracket[1])):              
                               tax += self.brackets_single[bracket] 
  
        elif fil_stat == 'joint':
           for bracket in self.brackets_joint:
                       if agincome &gt; bracket[0]:
                           for _ in range(bracket[0], min(agincome, bracket[1])):
                                tax += self.brackets_joint[bracket] 
  
        return tax
  
  
  mytest=taxCalc()          
  print(mytest.taxcal(75000, 'single', 1, 'TRUE')), format(round(mytest.taxcal(75000, 'single', 1, 'TRUE'),2)) 
  </code></pre>