Print Inverted Pyramid of Numbers Python Program

By | June 12, 2023

Print Inverted Pyramid of Numbers Python Program – This program will show am inverted pyramid of numbers as shown below:

Print Inverted Pyramid of Numbers Python Program

Print Inverted Pyramid of Numbers Python Program

Source Code

n = 5
num = n
for i in range(n, 0, -1):
    print(' ' * (n - i) + ' '.join(str(num) * i))
    num -= 1

Loading

Leave a Reply

Your email address will not be published. Required fields are marked *