Print Inverted Pyramid of Stars in Python

By | June 12, 2023

Print Inverted Pyramid of Stars in Python – Write a Python program to display inverted pyramid of stars.

Python Program to print inverted pyramid of stars

 

Source Code

n = 5
for i in range(n, 0, -1):
    print(' ' * (n - i) + '*' * (2 * i - 1))

Loading

Leave a Reply

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