title: How to make a list where the i-th element appears i times?
body: <p>It could be very easy question but i can't make it through this question. For example if n = 5, i want the answer list = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5]. If n = 6, i want the answer list = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6]</p>
  <p>The below code is what i made first time, but i even wonder this format is right to use.</p>
  <pre><code>rules = []
  rules.extend([x for x in range(n)])
  </code></pre>
  <p>if i use this kind of code, it only makes list =  [1, 2, 3, 4, 5 ...... , n] Should i change the x format to another things?</p>
  <pre><code>rules = []
  rules.extend([[x] * x for x in range(n)])
  </code></pre>
  <p>or if i use this kind of code, it makes list in the list format like this, list = [[1], [2], [2], [3], [3], [3]]</p>