This article will review different ways to generate pyramids and patterns in Python.

Half pyramid of asterisks

Output

An alternate way to generate half pyramid using nested loops in Python.

Program

Output

Half pyramid of X’s

Output

Half pyramid of numbers

Output

Generating a full pyramid of asterisks

Output

Full pyramid of X’s

Output

Reversed pyramid

Output

Leave a Comment