"""
Recommended Python Style Guide:
https://peps.python.org/pep-0008/#introduction
"""

ask_again = True
while ask_again:  # Continue asking until valid input is provided
    n = input("Enter a number larger than 0 = ")
    if n.isdigit():  # Ensure input is numeric
        n = int(n)
        if n > 0:  # Check if the number is positive
            ask_again = False  # Exit loop when valid number is provided
            for i in range(1, n + 1):  # Outer loop controls the rows
                for j in range(1, i):  # Print leading spaces for alignment
                    print(" ", end="")
                for k in range(1, n - i + 2):  # Print stars decreasing with each row
                    print("*", end="")
                print()  # Move to the next line after each row