title: Is there an elegant way to do "not in" in Julia?
body: <p>I am trying to convert a python script to Julia. I am checking to make sure I am doing this code in the most optimal way. Please see the following code: </p>
  
  <pre><code>julia&gt; a = [1,2,3,4,5]
  5-element Array{Int64,1}:
   1
   2
   3
   4
   5
  
  julia&gt; if 1 in a
             print("1 is in a")
         end
  1 is in a
  julia&gt; if 6 not in a
             print("6 not in a")
         end
  ERROR: TypeError: non-boolean (Int64) used in boolean context
  Stacktrace:
   [1] top-level scope at REPL[6]:1
  
  julia&gt; push!(a, 6)
  6-element Array{Int64,1}:
   1
   2
   3
   4
   5
   6
  julia&gt; if (6 in a) == true
             print("6 in a")
         end
  6 not in a
  julia&gt; b = [1]
  1-element Array{Int64,1}:
   1
  
  julia&gt; if (6 in b) == true
             print("6 in b")
         end
  
  
  </code></pre>
  
  <p>Am I doing this "not in" check correctly? </p>