Print number pyramid pattern Dry Run in PYTHON

Print number pyramid pattern is an interactive PYTHON dry run visualizer from the For programs section. Study the source code, then use the execution controls to follow each step, variable update, highlighted line, and console output.

This page provides a browser-based dry run with source-code highlighting, auto-scroll, voice narration controls, and execution output for learning the program step by step.

Print number pyramid pattern Program Code

# Number pyramid pattern
rows = int(input("Enter number of rows: "))

print("\nNumber Pattern:")
for i in range(1, rows + 1):
    # Print spaces
    for j in range(rows - i):
        print(" ", end=" ")
    # Print numbers
    for j in range(1, i + 1):
        print(j, end=" ")
    print()

View the complete For programs page.

Program Console Print number pyramid pattern Topic: PYTHON Vignaankosh.com
Execution Panel
Step 0/0
Console is empty.