Quick actions

cmd+k|ctrl+k

Navigation

Languages

world mudon

Snippet info

Language

Python

Visibility

public

Author

fjrbgs

Created

2023-07-09T02:34:33.393718Z

Updated

2023-07-09T03:09:17.733797Z

import ast

string = '[]'

# Safely evaluate the string as a list
values = ast.literal_eval(string)

# Enclose each value in double quotes
quoted_values = ['"' + value + '"' for value in values]

# Reshape the list into a 10x10 grid
grid = [quoted_values[i:i+10] for i in range(0, len(quoted_values), 10)]

# Print the grid vertically
for column in zip(*grid):
    print(",\n".join(column))
    print()
INFO