title: getting ZeroDivisionError: integer division or modulo by zero
body: <p>I had written a simple pascal triangle code in python but I am getting a error</p>
  
  <pre><code>def factorial(n):
      c=1
      re=1
      for c in range(n):
          re = re * c;
      return(re)
  
  print "Enter how many rows of pascal triangle u want to show \n"
  n=input();
  i=1
  c=1
  for i in range(n):
      for c in range(n-i-1):
          print ""
          for c in range(i):
              a = factorial(i);
              b = factorial(c);
              d = factorial(i-c);
              z = (a/(b*d));
              print "%d" % z
              print "\n"
  </code></pre>
  
  <p>ERROR:</p>
  
  <pre><code>Traceback (most recent call last):
    File "/home/tanmaya/workspace/abc/a.py", line 19, in &lt;module&gt;
      z = (a/(b*d));
  ZeroDivisionError: integer division or modulo by zero
  </code></pre>