title: simulating rolling 2 dice in Python
body: <p>I have been asked to simulate rolling two fair dice with sides 1-6. So the possible outcomes are 2-12.</p>
  
  <p>my code is as follows:</p>
  
  <pre><code>def dice(n):
      x=random.randint(1,6)
      y=random.randint(1,6)
      for i in range(n):
          z=x+y
      return z
  </code></pre>
  
  <p>My problem is that this is only returning the outcome of rolling the dice 1 time, so the outcome is always 2-12. I want it to return the sum of rolling the dice (n) times. </p>
  
  <p>Does anyone have any suggestions for me?</p>