title: PySpark When item in list
body: <p>Following is the action I'm trying to achieve:</p>
  
  <pre><code>types = ["200","300"]
  def Count(ID):
      cnd = F.when((**F.col("type") in types**), 1).otherwise(F.lit(0))
      return F.sum(cnd).alias("CountTypes")
  </code></pre>
  
  <p>The syntax in bold is not correct, any suggestions how to get the right syntax here for PySpark?</p>