title: NameError: name 'result' is not defined
body: <p>I have written a very simple program in python</p>
  
  <pre><code> for i in range(1,1000):
       if (i % 3 == 0) and (i % 5 == 0) :
             result += i
  
   else:
        print('sum is {}'.format(result))
  </code></pre>
  
  <p>When I try to compile the problem I am getting the error.</p>
  
  <pre><code>NameError: name 'result' is not defined
  </code></pre>