def print_inverted_pyramid(rows):
for i in range(rows, 0, -1):
print(" " * (rows - i), end="")
for j in range(1, 2 * i):
print("*", end="")
print()
# Example usage:
rows = int(input("Enter the number of rows for the inverted pyramid: "))
print_inverted_pyramid(rows)
To embed this project on your website, copy the following code and paste it into your website's HTML: