Exercise 2: Pyramid Printing by Using a For Loop

Print half a pyramid for a given number of rows.

Problem statement

Write the code that prints half a pyramid of the alphabet a. Enter an integer variable rows as input, and print the pyramid with that number of rows displaying a.

Sample input