This Python program reads an integer from the user and prints the '*' character in each line using a loop.
The number of lines is determined by the input value.
This exercise helps reinforce basic loop structures and character-based output formatting in Python.
def print_stars(n):
for i in range(n):
print("*")
# Run the program
rows = int(input("Enter number of lines: "))
print_stars(rows)
*
*
*
*
- The program first reads the number of lines from the user
- A for loop runs for the specified number of iterations
- In each iteration, the '*' character is printed on a new line
- This creates a vertical column of asterisks