[13 / 3 / 5]
Any idea what loops I should use for this?
Problem “Triangles” Write a program to create the following figure by using nested for loops. Please use parameters in order to change the size and number of triangles as in the examples below, while being able to reuse the code. Desired output for SEGMENT = 3 and HEIGHT = 4
*
***
*****
*******
*
***
*****
*******
*
***
*****
*******
Desired output for SEGMENT = 2 and HEIGHT = 6
*
***
*****
*******
*********
***********
*
***
*****
*******
*********
***********
Problem “Triangles” Write a program to create the following figure by using nested for loops. Please use parameters in order to change the size and number of triangles as in the examples below, while being able to reuse the code. Desired output for SEGMENT = 3 and HEIGHT = 4
*
***
*****
*******
*
***
*****
*******
*
***
*****
*******
Desired output for SEGMENT = 2 and HEIGHT = 6
*
***
*****
*******
*********
***********
*
***
*****
*******
*********
***********