title: How to ignore '\n' while comparing two lists
body: <p>I have two lists. I want to check if one list is a subset of other list or not.</p>
  
  <pre><code>list1 = ['12345678\n', '87654321']
  list2 = ['01234567','12345678', '87654321', '23456789']
  </code></pre>
  
  <p>The problem is my first list i.e. <strong>list1</strong> will always contain <strong>\n</strong> since I'm reading it from a file which has item(s) in separate lines.But I want to ignore this <strong>\n</strong> and continue comparing.The below code of mine is always going into <strong>else</strong> part. Is there any way to acheive the <strong>True</strong> scenario without modifying both the lists ?
  <strong>My code below:</strong></p>
  
  <pre><code>flag = True                 # Initialized value of flag to default 'True' at beginning
  
  for val in list1:
    if val not in list2:
       flag = False
  
  if flag == True
    ....                          # Do some operation if flag is 'True'
    ....
  else
    print 'list1 is not a subset of list2'    
  </code></pre>