in Python by
Q:
Write a program in Python to produce Star triangle?

1 Answer

0 votes
by
The code to produce star triangle is as follows:

1

2

3

4

def pyfun(r):

for a in range(r):

print(' '*(r-x-1)+'*'*(2*x+1))  

pyfun(9)

Output:

1

2

3

4

5

6

7

8

9

        *

       ***

      *****

     *******

    *********

   ***********

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

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

*****************
Click here to read more about Python
Click here to read more about Insurance

Related questions

0 votes
asked May 17, 2020 in Python by sharadyadav1986
0 votes
asked Dec 14, 2019 in Python by sharadyadav1986
...