Print Star Pattern in Python
Print a right-angled triangle star pattern using nested loops.
BeginnerLoop ProgramsExample 17 of 25
print-star-pattern.py
Run in browser1# Program to print a right-angled star pattern23rows = int(input("Enter number of rows: "))45for i in range(1, rows + 1):6 print("*" * i)
Output
Enter number of rows: 4 * ** *** ****
What's going on
We print each row as "*" repeated i times, leveraging string multiplication.