This Python program reads the number of rows from the user.
It then prints a pyramid of stars, aligned to the right, where each row contains one more star than the previous.
The spacing ensures the triangle shape is visually balanced.
rows = int(input("Enter number of rows: "))
for i in range(1, rows + 1):
print(" " * (rows - i), end="") # spacing for alignment
print("* " * i)
*
* *
* * *
* * * *
* * * * *
- The outer loop runs from 1 to rows
- Each row begins with spaces to align the stars to the right
- Then i stars are printed with a space between each
- The result is a clean, right-aligned pyramid of stars