Question: I'm not able to remove the spacing in a `for`-loop as numbers are not coming in the same for making the pattern.

My code:

```
for i in range(1,5):
    for j in range(1,i):
       print(j)

```

Produces the following result:

```
1
1
2
1
2
3

```

But my desired output is:

```
1
12
123
1234

```

Answer: 
```
for r in range(1,5):
    for c in range (1,r+1):
        print c,
    print

```

here, the print without argument causes printing in the next line
I thought the idea of @Shiva was really nice and made a slightly more general pyramid function, maybe someone can use/enjoy it it:

```py
def pyramid(n_rows, s, upside_down=False, offset=0):
    whites = ' ' * len(s)
    offset = ' ' * offset

    indices = np.arange(n_rows)

    if upside_down:
        indices = zip(indices[::-1]+1, indices)
    else:
        indices = zip(indices+1, indices[::-1])

    for i, j  in indices:
        print(f"{offset + whites * j}{(s + whites) * i}")

pyramid(4, 'SO')
#       SO  
#     SO  SO  
#   SO  SO  SO  
# SO  SO  SO  SO  

pyramid(4, '*', upside_down=True, offset=3)
#    * * * * 
#     * * * 
#      * * 
#       * 

```