Create a program in Python that prints the following figure with the given number of units.
7
for row in range(7):
    for col in range(7):
        if (row + col) % 2 == 0:
            print('#', end='')
        else:
            print(' ', end='')
    print()