title: How can I compare 2 list and remove the a string from 1 list that contain a substring from other list? Python
body: <p>is there anyway I can remove a specific string if other list contain a substring of it? For example:
  list x contain the substring, since y[0] have 'hi'(which contain in list x) inside the word, I would like to remove it.</p>
  <pre><code>x=[&quot;yo&quot;,'sup','hi']
  
  y= ['hi-test','test2','test3']
  </code></pre>
  <p>This is what I have try, but I think my concept are wrong.</p>
  <pre><code>x=[&quot;yo&quot;,'sup','hi']
  y= ['hi-test','test2','test3']
  list1=[]
  for namex in x:
      for namey in y:
          if namex in namey:
              break
          else:
              list1.append(namey)
  
  print(list1)
  </code></pre>
  <p>I would like to get a list with 'test2' and 'test3'.</p>