Python Increasing-Number Diamond (Pattern 56)

Python Code
size = 3
for x in range(size, -(size + 1), -1):
    for y in range(abs(x), size + 1):
        print(y, end="")
    print()

Output:

Output of the Python Increasing-Number Diamond pattern
BEGINNER WALKTHROUGH

How the Increasing-Number Diamond works

The rows grow from 3 to 0123 at the center, then repeat in reverse order on the lower half.

01

Build the rows

The outer loop moves through positive and negative x values; abs(x) gives matching row lengths on either side.

02

Choose what each row prints

The inner y counter starts at abs(x) and counts up to 3, so the center row includes 0, 1, 2, and 3.

03

Keep the output aligned

The inner print calls use end="" to keep values on the same line. The final empty print() moves to the next row.