0 votes
in Python by
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

        *

       ***

      *****

     *******

    *********

   ***********

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

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

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

Related questions

+1 vote
asked May 17, 2020 in Python by sharadyadav1986
0 votes
asked Dec 22, 2019 in Python by rajeshsharma
...