title: TypeError: 'int' object is not subscriptable in equation
body: <p>This is my fourth python script, so please bear with my newbieness... I am writing a script that tells the day of week on a certain date.  It all runs fine except one error.  I have a faint idea as to what is wrong, but am not too certain:</p>
  
  <blockquote>
    <p>TypeError: 'int' object is not subscriptable</p>
  </blockquote>
  
  <pre><code>#!/usr/bin/python
  import sys, string
  
  # Call example:  day_of_week(2,10,1988); February 10, 1988
  def day_of_week(month, date, year):
      # January
      if month == 1: m = 11
      # February
      elif month == 2: m = 12
      # March
      elif month == 3: m = 1
      # April
      elif month == 4: m = 2
      # May
      elif month == 5: m = 3
      # June
      elif month == 6: m = 4
      # July
      elif month == 7: m = 5
      # August
      elif month == 8: m = 6
      # September
      elif month == 9: m = 7
      # October
      elif month == 10: m = 8
      # November
      elif month == 11: m = 9
      # December
      elif month == 12: m = 10
  
      # Calculate the day of the week
      dow = (date + ((13 * m-1)/5) + year[2:] + (year[2:]/4) + (year[:2]/4) - 2 * year[:2]) % 7)
  
      # Formatting!
      if dow == 0: return "Sunday"
      elif dow == 1: return "Monday"
      elif dow == 2: return "Tuesday"
      elif dow == 3: return "Wednesday"
      elif dow == 4: return "Thursday"
      elif dow == 5: return "Friday"
      elif dow == 6: return "Saturday"
      else: return "Error!"
  
  try:
      m = int(raw_input("What month were you born in (1-12)?  "))
      if not 1 &lt;= m &lt;= 12: raise Exception("There are no months with a number higher than 12!")
      d = int(raw_input("On what date were you born on?  "))
      y = int(raw_input("What year were you born in?  "))
      print("\nYou were born on a %s!" % day_of_week(m,d,y))
  except ValueError:
      print("You need to enter a number!")
  </code></pre>