title: If in loop, nonetype
body: <p>I'm writting some code in which I try to check every number in a range using a for loop and an if statement. The loop stops after the first check, and throws an error with message  <em>wrong type ,,None,, expected integer</em>, I'll give you what I have been asked to do:</p>
  
  <p>Define a function findLine(prog, target) to perform the following. Assume prog is a list of strings containing a BASIC program, like the type generated by getBASIC(); assume target is a string containing a line number, which is the target of a GOTO statement. The function should return the index i (a number between 0 and len(prog)-1) such that prog[i] is the line whose label equals target. Hint 
  Sample input/output: If you call
  findLine(['10 GOTO 20','20 END'], '10')</p>
  
  <pre><code>def findLine(prog, target):
    L=[]
    for i in range(0, len(prog)):
       L=L+prog[i].split()
    for j in range(0,len(L)):
       i=L.index(L[j])
       if j == int(target):
         i=i//3
         return i
  </code></pre>
  
  <p>These is some information :</p>
  
  <pre><code>Running findLine(['10 GOTO 20', '20 END'], '20')… Error: findLine(['10 GOTO 20', '20 END'], '20') has wrong type "None" Type, expected Integer
  </code></pre>