for loop right-triangles not separating
<pre><code>base=int(input("Enter the triangle size: "))
for i in range(1, base + 1):
    print (('*' * i) + (' ' * (base - i)))
for i in range(1, base + 1)[::-1]:
    print (('*' * i) + (' ' * (base - i)))
for i in range(1, base + 1):
    print (' ' * (base - i) + ('*' * i))
for i in range(1, base + 1)[::-1]:
    print (' ' * (base - i) + ('*' * i))
</code></pre>

<p>The output looks like this: </p>

<pre><code>Enter the triangle size: 4
*   
**  
*** 
****
****
*** 
**  
*   
   *
  **
 ***
****
****
 ***
  **
   *
&gt;&gt;&gt; 
</code></pre>

<p>But I need it to look like this: </p>

<pre><code>Enter the triangle size: 4
*   
**  
*** 
****

****
*** 
**  
*   
   *
  **
 ***
****

****
 ***
  **
   *
&gt;&gt;&gt; 
</code></pre>

<p>I tried everything to create a new line after each for loop but it just outputted a mess. Is there any way I can tweak my program to allow for those spaces? Thanks!</p>

<p>I've just added prints between triangles to reproduce the expected output. Is that what you want ?</p>

<pre><code>base=int(input("Enter the triangle size: "))
for i in range(1, base + 1):
    print (('*' * i) + (' ' * (base - i)))
print()
for i in range(1, base + 1)[::-1]:
    print (('*' * i) + (' ' * (base - i)))
for i in range(1, base + 1):
    print (' ' * (base - i) + ('*' * i))
print()
for i in range(1, base + 1)[::-1]:
    print (' ' * (base - i) + ('*' * i))
</code></pre>

<p>Output:</p>

<pre><code>Enter the triangle size: 4
*   
**  
*** 
****

****
*** 
**  
*   
   *
  **
 ***
****

****
 ***
  **
   *
</code></pre>

python python-3.x for-loop