title: How to check if a value in one list is in another list with a one-liner for an if statement in Python if I'm not using sets?
body: <p>I'm trying to construct a one liner that would check if any of the values in one list are present in another list and return True or False if it does or does not.</p>
  
  <p>The closest I've gotten to is the following:</p>
  
  <pre><code>[i in list1 for i in list2]
  </code></pre>
  
  <p>The problem with this is that it will iterate through list1 and output a list of True and Falses depending on if the items in list1 exist in list2. </p>
  
  <p>What I can do is then iterate through this newly created True and False list but I can't do that in the same line. I can't use a set in this case or import any functions as I'm using this as a condition in a third party software where you can't insert sets in conditions or use functions.</p>