**Code-1**

line = ‘*’

n = 5

while len(line) <= 6 :

```
print(" "*n + line)
line = line + "*"
n -= 1
```

while n < 5:

```
print(" "*(n+2) + line[n+2:-1])
n += 1
```

Desired output:-

*

**

***

****

*****

******

*****

****

***

**

*

**Code-2**

line = ‘*’

n = 5

while len(line) <= 11 :

```
print(" "*n + line + " "*n)
line = line + "**"
n -= 1
```

while n < 5:

```
print(" "*(n+2) + line[n+2:-(n+4)] + " "*(n+2))
n += 1
```

desired output:-

*

***

*****

*******

*********

***********

*********

*******

*****

***

*

above codes are giving desired output, is there any other solution for this?