Triangles

1. Write a function that takes in number as argument and draws a right angled triangle using the “ * “ characters. If the input is 4, then the output is a traingle with height 4

Input

let triangle(4) =>
def triangle(n):

Output

expected output: RIGHT ANGLE TRIANGLE

 *
 **
 ***
 ****

2. Write a function that takes in number as argument and draws a reflection/mirror of right angled triangle above using the “ * “ characters . If the input is 4, then the output is a traingle with height 4

Input

let triangle(5) =>
def triangle(n):

Output

expected output: MIRROR OF RIGHT ANGLE TRIANGLE
   *
  **
 ***
****

3. Write a function that takes in number as argument and draws a Hollow right angled triangle above using the “ * “ characters . If the input is 4, then the output is a traingle with height 4

//javascript
function triangle(5)
def trianlge(n):
expected output => HOLLOW RIGHT ANGLE TRIANGLE AND FOR ITS MIRROR.

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

RAW CONTENT URL