title: how do I convert the elements of a list to integers?
body: <p>I'm doing beginner python IO stuff, and I have to import a file. In the file there are a bunch of dates and and the year, month and day are separated by commas. I've split them but need them to be integers, how would I do that? I've tried a few different things but they all say "ValueError: invalid literal for int() with base 10: '4076.79\n'"</p>
  
  <pre><code>salesFile = "Sales.txt"
  
  try:
      inpFile = open(salesFile, "r")
  except:
      print "error"
  else:
      startYear = 2001 
      startMonth = 1 
      startDay = 1 
      endYear = 2001 
      endMonth = 2 
      endDay = 1 
      print startYear, startMonth, startDay
      print endYear, endMonth, endDay
      validItem = True
      while validItem == True:
          line = inpFile.readline()
          if line == "":
              validItem = False
          word = line.split(",")
          numWords = len(word)
          for idx in range(numWords):
              temp = word[idx]
              temp = int(temp)
              word[idx] = temp
  </code></pre>