title: python error UnboundLocalError and issue with logic
body: <p>This is what I've written:</p>
  <pre><code>def logic( arr , r , l ):
  
  
      arr = []
      i == 0
      
      if (arr[i]) == (i +1) * i :
          print('True')
          i = i + 1
      else :
          print('False')
      return(arr )
  
  
  arr = list(map(int, input().split()))
  r = int(input())
  l = int(input())
  print(logic(arr,r,l))
  </code></pre>
  <p>This is what we need:</p>
  <p>You task is to calculate a boolean array b, where b[i] = true if there exists an integer x,
  such that a[i] = (i + 1) * x and l ≤ x ≤ r. Otherwise, b[i] should be set to false.</p>
  <p>Example</p>
  <p>For a = [8, 5, 6, 16, 5], l = 1, and r = 3, the output should be logic(a, l, r) = [false, false, true, false, true].</p>
  <pre><code>For a[0] = 8, we need to find a value of x such that 1 * x = 8, but the only value that would work is x = 8 which doesn't satisfy the boundaries 1 ≤ x ≤ 3, so b[0] = false.
  For a[1] = 5, we need to find a value of x such that 2 * x = 5, but there is no integer value that would satisfy this equation, so b[1] = false.
  For a[2] = 6, we can choose x = 2 because 3 * 2 = 6 and 1 ≤ 2 ≤ 3, so b[2] = true.
  </code></pre>
  <p>Below is the error:</p>
  <p>UnboundLocalError: local variable 'i' referenced before assignment</p>