"""
Recommended Python Style Guide:
https://peps.python.org/pep-0008/#introduction
"""

"""
Solution 1: With nested loops
"""

while True:  # Infinite loop to keep asking for valid input
    n = input("Enter a number larger than 0: ")
    if not n.isdigit():  # If the input is not a digit, repeat the loop
        continue

    n = int(n)  # Convert input to an integer
    if n > 0:  # Proceed only if the number is greater than 0
        for i in range(n):
            print("*", end="")  # Print stars in a single line
        print()  # Move to the next line after printing a row
        break  # Exit the infinite loop once a valid input is received

"""
Solution 2: Without nested loops, with string replication (*)
"""

while True:  # Infinite loop to keep asking for valid input
    n = input("Enter a number larger than 0: ")
    if not n.isdigit():  # If the input is not a digit, repeat the loop
        continue

    n = int(n)  # Convert input to an integer
    if n > 0:  # Proceed only if the number is greater than 0
        stars = "*" * n  # Calculate number of stars
        print(stars)  # Print stars in a single line

        break  # Exit the loop once a valid input is received