title: python: TypeError: Can't convert 'list' object to str implicitly
body: <p>I am getting the following error with Python 3.1.4 which used to work well in Python 2.7.2.</p>
  
  <pre><code>TypeError: Can't convert 'list' object to str implicitly. I get the error on the if statement. Please let me know how to fix this. Thanks!
  </code></pre>
  
  <p>In</p>
  
  <pre><code>for word in keywords: # Iterate through keywords
      if re.search(r"\b"+word+r"\b",line1):           #Search kewords in the input line
  </code></pre>
  
  <p>Update1:</p>
  
  <p>I am trying to create a list from keywords which is in a file. Each line has one keyword. Am I reading the file properly?</p>
  
  <pre><code>keyword_file=r"KEYWORDS.txt"
  f0=open(keyword_file,'r')
  keywords = map(lambda a: a.split('\n'),map(str.lower, f0.readlines()))
  </code></pre>
  
  <p>keyword file contains:</p>
  
  <pre><code>Keyword1
  Keyword2
  .
  .
  .
  Keywordn
  </code></pre>
  
  <p>I want a list called <code>keywords = ['Keyword1','Keyword2',...,'Keywordn']</code></p>