def count_rows(data):
    return len(data)

def count_columns(data):
    return len(data[0]) if data else 0

def list_columns(data):
    return list(data[0].keys()) if data else []

def sample_data(data, n=5):
    return data[:n]


def show(data, limit=None):
    if not data:
        print("No data available.")
        return

    headers = list(data[0].keys())

    # Calculate column widths
    col_widths = {}
    for header in headers:
        max_len = max(len(str(row[header])) for row in data)
        col_widths[header] = max(max_len, len(header)) + 2

    # Print header
    print("-" * 100)
    header_row = ""
    for header in headers:
        header_row += header.ljust(col_widths[header])
    print(header_row)
    print("-" * 100)

    # Print rows
    rows = data if limit is None else data[:limit]

    for row in rows:
        row_str = ""
        for header in headers:
            row_str += str(row[header]).ljust(col_widths[header])
        print(row_str)

    print("-" * 100)