title: cant break out of Python While loop
body: <p>I'm quite new to Python so sorry in advance, I'm trying to break out of a While loop if a random number is not within a List of numbers.
  Despite testing the output of the functions and confirming that an integer is in the List and it is in fact an integer and other methods return both True and False the While Statement ignores the value. See demo code.</p>
  <pre><code>import random,time
  list=[i for i in range(10)]
  print(list)
  
  print(list[6]*10) # this returns an integer
  if list[6]==12/2:
      print('this evaluates as a int')
  
  this=99 # sentry to run the while loop   **** but cant index by
  
  if 10/2 in list:
      print('this also evaluates as an integer')
  print(type(list))
  print(type(this))
  while this not in list:
      this = random.randrange(9)
      print(this,this in list)
      time.sleep(.200)
      list[this] = '*'
  
  &gt;&gt;&gt;
  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  60
  this evaluates as a int
  this also evaluates as an integer
  &lt;class 'list'&gt;
  &lt;class 'int'&gt;
  6 True
  3 True
  4 True
  </code></pre>
  <p>5 True</p>
  <pre><code>5 False
  </code></pre>