title: How to check whether there is specific year in phrase?
body: <p>I have a list of sport game names and need to take out year from it. Say, we have game name 'NHL 2008' in the list, and I need to take 2007 as a game release year  out of the phrase.  Trying to do this:</p>
  <pre><code>years = list(range(1900,2017))
  print(years)
  def correct_year(game_name):
      correct_year=0
      for year in years:
          if year in game_name:
              correct_year=year-1
      return correct_year
  
            
  print(correct_year('NHL 2008'))
  
  </code></pre>
  <pre><code>TypeError: 'in &lt;string&gt;' requires string as left operand, not int
  
  </code></pre>
  <p>How can I check it correctly and get the 'year-1' value?</p>