This Python program reads an integer n between 1 and 80 and prints a left-aligned triangle of asterisks (*) with n rows.
Each row contains one more asterisk than the previous, forming a simple triangular pattern aligned to the left.
# Read n from user
n = int(input("Enter a number between 1 and 80: "))
# Validate input
if 1 <= n <= 80:
for i in range(1, n + 1):
print('*' * i)
else:
print("The number must be between 1 and 80.")
*
**
***
****
*****
******
*******
- The user inputs a number n
- The program checks that n is within the valid range
- A loop runs from 1 to n
- In each iteration, i asterisks are printed on the same line
- The result is a left-aligned triangle of height n