title: Counter up or down script not working python
body: <p>I'm trying to create a script that counts up if start &lt; stop or count down is start &lt; stop. I'm getting part of the output but not all. Any tips?</p>
  
  <pre><code>def counter(start, stop):
  x = start
  if x &gt; stop:
      return_string = "Counting down: "
      while x &gt; stop:
          return_string += str(x)
          if x == stop:
              return_string += ","
          return return_string
  else:
      return_string = "Counting up: "
      while x &lt;= stop:
          return_string += str(x)
          if x == stop:
              return_string += ","
          break
  return return_string
  </code></pre>
  
  <pre><code>         print(counter(1, 10)) # Should be "Counting up: 1,2,3,4,5,6,7,8,9,10"
           print(counter(2, 1)) # Should be "Counting down: 2,1"
           print(counter(5, 5)) # Should be "Counting up: 5"
  </code></pre>