How to add a new line after each loop?
<p>Currently getting this output</p>

<pre><code>[1, 1, 3, '\n']
[1, 1, 3, '\n', 7, 7, 7, '\n']
</code></pre>

<p>looking for this output</p>

<pre><code>[1, 1, 3]
[7, 7, 7]
</code></pre>

<p>Code:</p>

<pre><code>    import random
    my_list=[]
    n = 3
    m = 1
    while m &lt; 10:
    for i in range(n): # repeats the following line(s) of code n times
        my_list.append(random.randrange(0,9))
    my_list.append("\n")
    print(my_list)
    m = m+1
</code></pre>

<pre><code>import random
n = 3
m = 0
my_list = []
while m &lt; 10:
    my_list.append([])
    for i in range(n):
        my_list[m].append(random.randrange(0, 9))
    print(my_list[m])
    m = m + 1
</code></pre>

<p>This code creates sublists inside <code>my_list</code>, and prints out each sublist every iteration. So your output might be something like this:</p>

<pre><code>[0, 4, 8]
[3, 1, 5]
...
[9, 2, 5]
</code></pre>

<p>but <code>my_list</code> would store all the sublists, like this: <code>[[0, 4, 8], [3, 1, 5], ..., [9, 2, 5]]</code></p>

python python-3.x while-loop