Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
The function printPyramid refers to a code snippet that creates a pyramid-like pattern using a series of print statements. It takes a number as input and prints out lines of characters, each line having one more character than the previous line.
Related terms
blocks: Each iteration in the inner loop represents adding one block to the current row of the pyramid.
rows: Refers to the total number of rows or layers in the pyramid.
characters: The characters being printed on each row, which increases by one with each iteration.