title: Increment the value inside a list element
body: <p>I'm having one of 'those' days, and everything I'm looking at is just messing up.</p>
  
  <p>I have a Die class (as in Dice) and I want to roll 100 of them, and count the occurrences of each number. Say, out of 100 dice, 40 were the number '6'.</p>
  
  <p>The issue is, if I hardcode a if face_value == 1 type of solution - if someone changes the amount of faces on the die - I've got a bit of an issue - as it won't count them.</p>
  
  <p>I thought the best way to account for this would be to make a list (which is the same size as the possible die faces) and increment the number inside the list on each occurrence.</p>
  
  <p><strong>In short, how can I increment the value inside of each list element?</strong></p>
  
  <pre>diceList = [ Die() for q in range(100)]</pre>
  
  <pre>
  import random
  
  class Die:
      face_value = 1
      size = 6
  
      def getSize(self):
          return self.size
  
      def getFaceValue(self):
          return self.face_value
  
      def roll(self):
          self.face_value = random.randint(1, self.size)
  </pre>
  
  <pre>
  def rollList(n):
      i = 0
  
      a = n[0].getSize()
      faceList = [0] * a
  
          for Die in n:
              n[i].roll()
              x = n[i].getFaceValue()
              print(n[i].face_value)
  
              #faceList[x-1] = 1+1
              #print(faceList)
              i += 1
  </pre>
  
  <hr>
  
  <p>I've re-worked it a little, and I've got a way of getting the answer - I'm not sure if it's a particularly good way of doing it though.</p>
  
  <pre>
  def rollList(n):
      i = 0
      faceList = []
      a = n[0].getSize()
      for Die in n:
          n[i].roll()
          x = n[i].getFaceValue()
          faceList.append(x)
          i += 1
  
      print(faceList)
  
      c = 1
      while a >= c:
          print(faceList.count(c))
          c += 1
  </pre>