Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
614 B
1
Indexable
Never
def draw_grid(n, row_size=4, col_size=4):
    """
    Draws a grid of size n x n, with each cell of size row_size x col_size.

    Args:
    n (int): The number of rows and columns in the grid.
    row_size (int): The number of rows in each cell. Defaults to 4.
    col_size (int): The number of columns in each cell. Defaults to 4.

    Returns:
    None
    """
    for i in range(n):
        if i % 2 == 0:
            print("+" + "-" * (col_size * n) + "+")
        for j in range(n):
            if j % 2 == 0:
                print("|", end="")
            print(" " * col_size + "|", end="")
        print()
Leave a Comment