title: Output factorials with while loop
body: <p>My code is supposed to take an input and then output the factorials up to the inputted number</p>
  
  <p>For example, if the input is 8 the output would be 1,2,6,24,120,720,5040,40320. </p>
  
  <p>I thought I had the right functions set up for this, however I just get an infinite loop of negatives.</p>
  
  <pre><code>limit=input('enter a value for limit:')
  limit=int(limit)
  ctr=0
  factorial=1
  while ctr &lt; (limit):
      print (ctr, end=' ')
      factorial=factorial*ctr
      ctr=ctr-1
  print("limit =", limit)
  </code></pre>