This Python program reads an integer n between 1 and 8 and prints a two-part pattern:
1. An increasing triangle made of checkmarks (✓)
2. A decreasing sequence of horizontal lines made of asterisks (*)
The first part always prints 3 rows of checkmarks. The second part prints lines of stars starting from n down to 1.
# Read n from user
n = int(input("Enter a number between 1 and 8: "))
# Validate input
if 1 <= n <= 8:
# Part 1: Checkmark triangle
for i in range(1, 4):
print('✓' * i)
# Part 2: Decreasing star lines
for i in range(n, 0, -2):
print('*' * i)
else:
print("The number must be between 1 and 8.")
✓
✓✓
✓✓✓
*******
*****
***
*
- The user inputs a number n
- The first loop prints 3 rows of checkmarks, increasing by one per row
- The second loop prints horizontal lines of stars, decreasing from n to 1 in steps of 2
- This creates a visually balanced pattern combining symbols and structure