This Python program prints a descending triangle of numbers.
Each row starts from a decreasing number and prints down to 1.
The first row starts at 7 and the last row contains only 1.
# Generate descending triangle
for start in range(7, 0, -1):
for num in range(start, 0, -1):
print(num, end=" ")
print()
7 6 5 4 3 2 1
6 5 4 3 2 1
5 4 3 2 1
4 3 2 1
3 2 1
2 1
1
- The outer loop starts from 7 and decreases to 1
- The inner loop prints numbers from the current start value down to 1
- end=" " keeps numbers on the same line
- print() moves to the next row after each line