def print_number_pyramid(rows):
    for i in range(1, rows + 1):
        print(" " * (rows - i), end="")
        for j in range(1, i + 1):
            print(j, end=" ")
        print()

# Example usage:
rows = int(input("Enter the number of rows for the number pyramid: "))
print_number_pyramid(rows)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: