Exercise 2: Pyramid Printing by Using For Loop

Let's print half a pyramid for a given number of rows.

Problem Statement

In this exercise, you have to write the code that prints half a pyramid of the alphabet a. You have to enter an integer variable rows as input and print the pyramid with that number of rows displaying a.

Sample input

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy