Why is int2word program only prining first ten lines? : <p>I am importing a file the counts in words from one to ninety-nine. The goal is to read each line and return an integer value corresponding to the word in the file. However, I cannot seem to figure out why my code is only working for the first ten numbers/lines?</p>

<pre><code>def word_to_int(w):
  i = 0  

  ones = [[1,'one'], [2,'two'], [3,'three'], [4,'four'], [5,'five'], [6,'six'], [7,'seven'], [8,'eight'], [9,'nine']]

  teens = [[10,'ten'], [11,'eleven'], [12,'twelve'], [13,'thirteen'], [14,'fourteen'], [15,'fifteen'], [16,'sixteen'], [17,'seventeen'], [18,'eighteen'],[19,'nineteen']]

  tens = [[2,'twenty'], [3,'thirty'], [4,'forty'], [5,'fifty'], [6,'sixty'], [7,'seventy'], [8,'eighty'], [9,'ninety']]

  if(w.find ('-') != -1): 
    a = w.split('-')                          #gets rid of hyphen and seperates parts
    for first in tens:
      if(a[0] == first[1]):                   #first half of word
        i = first[0]*10
    for second in ones:
      if (a[1] == second[1]):                 #second half of word
        i += second[0]

  else:
    for num in ones:
      if w == num[1]:
        i = num[0]

  if(i == 0):
    for num2 in teens:
      if w == num2[1]:
        i == num2[0]

  if(i == 0):
    for num3 in tens:
      if w == num3[1]:
        i = num3[0]*10
    return i    
</code></pre>

<p>any ideas?</p>
