# Function to print a right-angled triangle
def print_triangle(n):
for i in range(1, n+1):
for j in range(i):
print("*", end=" ")
print()
def print_triangle(n):
for i in range(1, n+1):
for j in range(i):
print("*", end=" ")
print()
# Example usage
print_triangle(5)
------------------------------------------------
Program output:
*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * * *
* * * * * * * * *
* * * * * * * * * *
*
* *
* * *
* * * *
* * * * *
* * * * * *
* * * * * * *
* * * * * * * *
* * * * * * * * *
* * * * * * * * * *
0 Comments