How to add the same element N times? : <p>I have two lists:</p>

<pre><code>list1 = [1,2,6]
list2 = []
</code></pre>

<p>And i have a number: N</p>

<p>How can I append the numbers of list1 to list2 so that the sum of the list2 is equal to N.</p>

<p>Exemple:</p>

<pre><code>n = 10
list2 = [2,2,6]
</code></pre>

<p>I could not find a way to add the 2 until the sum equal to 10 </p>
