Print concentric rectangular patterns
Simplify

I find the logic a bit complicated. It could be simpler:


Loop from -A to +A, let's call the loop variable n
Take the absolute value of n
Generate the values in the row:


Loop from -A to +A, let's call the loop variable m
Use the maximum of abs(n) + 1 and abs(m) + 1



Like this:

def pretty_print(num):
    def print_line(n):
        low = abs(n)
        print(' '.join(str(max(low + 1, abs(i) + 1)) for i in range(-num + 1, num)))

    for i in range(-num + 1, num):
        print_line(i)


Testing

Doctests are awesome, I recommend to use them.
Here's the complete solution with doctests,
you can run this with python -mdoctest pretty_print.py:

#!/usr/bin/env python


def pretty_print(num):
    """
    &gt;&gt;&gt; pretty_print(1)
    1

    &gt;&gt;&gt; pretty_print(2)
    2 2 2
    2 1 2
    2 2 2

    &gt;&gt;&gt; pretty_print(6)
    6 6 6 6 6 6 6 6 6 6 6
    6 5 5 5 5 5 5 5 5 5 6
    6 5 4 4 4 4 4 4 4 5 6
    6 5 4 3 3 3 3 3 4 5 6
    6 5 4 3 2 2 2 3 4 5 6
    6 5 4 3 2 1 2 3 4 5 6
    6 5 4 3 2 2 2 3 4 5 6
    6 5 4 3 3 3 3 3 4 5 6
    6 5 4 4 4 4 4 4 4 5 6
    6 5 5 5 5 5 5 5 5 5 6
    6 6 6 6 6 6 6 6 6 6 6
    """

    def print_line(n):
        low = abs(n)
        print(' '.join(str(max(low + 1, abs(i) + 1)) for i in range(-num + 1, num)))

    for i in range(-num + 1, num):
        print_line(i)

pretty_print(6)


Style

There are some minor style issues with the posted code.
I suggest to follow the PEP8 guidelines.