title: Does importing random affect use of while loops?
body: <p>This code snippet is from a python course being taught at a middle school. The file imports turtle and then random to allow for colors to be selected from a list while the square is being drawn. I tried changing the if to a while loop, and got an unexpected result. The loop continues after num = 0, printing 0 indefinitely. I tried removing the decrement outside of the call to 
  sqspin(num-1) and doing the decrement on the line above like so: num = num -1
  This change started creating random changes to the printed value of num for each successive loop after num reached 0 for the first time. I don't understand why while num > 0 doesn't terminate the loop when num = 0, or where those random values for num are coming from. Any clues? 
  I'm running 3.4.3, but the school is using 2.7.</p>
  
  <pre><code>from turtle import *
  from random import *
  
  shape("turtle")
  st()
  
  def sq():
      fd(100)
      rt(90)
      fd(100)
      rt(90)
      fd(100)
      rt(90)
      fd(100)
      rt(90)
  
  colors = ['red', 'green', 'orange', 'blue', 'yellow']
  
  def  pickcolor():
      return choice(colors)
  
  def sqspin(num):
      print(num)
      if num &gt; 0:
          sq()
          rt(5)
          mycolor = pickcolor()
          pencolor(mycolor)
          sqspin(num-1)
  
  sqspin(5)
  </code></pre>