def format_grid(grid):
    """
    Formats each row to represent list value delimited by spaces

    :param list grid: input with nested lists to format
    """
    formatted_grid = ''
    for row in grid:
        # list comprehension used to explicitly cast items to str
        # this allows for the grid param to consist of non-str variables
        formatted_grid += ' '.join([str(item) for item in row]) + '\n'
    return formatted_grid