title: Calculating factorials with Python
body: <p>EDIT: I know I can import factorials but I'm doing this as an exercise</p>
  
  <p>Trying to get the factor of a given number with a function in Python.</p>
  
  <p>For example:
  factorial(4) = 4 * 3 * 2 * 1 = 24</p>
  
  <pre><code>def factorial(x):
      n = x
      while n &gt;= 0:
          x = n * (n - 1)
          n -= 1
      return x
  </code></pre>