Print Star Pattern

Print a right-angled triangle star pattern using nested loops.

PythonBeginner
Python
# Program to print a right-angled star pattern

rows = int(input("Enter number of rows: "))

for i in range(1, rows + 1):
    print("*" * i)

Output

Enter number of rows: 4
*
**
***
****

We print each row as "*" repeated i times, leveraging string multiplication.