Python program to print inverted right-angled triangle using number

Python program to print inverted right-angled triangle using number. In the Python programming language, there is a down facing number pattern. In the output, this program will print the number inverted. The performance of this program will be printed backwards.

lines = 3
b = 0
for i in range(lines, 0, -1):
b += 1
for j in range(1, i + 1):
print(b, end=' ')
print('\r')

 

Output:

2 2 2 2 2 2 2 2 2

3 3 3 3 3 3 3 3

4 4 4 4 4 4 4