Welcome folks today in this blog post we will be printing inverted pyramid of numbers pattern using for loop in python.
All the full source code of the application is given below.
Get Started
In order to get started you need to make an app.py
file and copy paste the following code
Printing Inverted Numbers Pattern
app.py
1 2 3 4 5 6 7 8 9 10 11 12 13 |
rows = 5 b = 0 for i in range(rows, 0, -1): b += 1 for j in range(1, i + 1): print(b, end=’ ‘) print(‘\r’) |
Now if you execute the python
script by typing the below command as shown below
python app.py