Context: I want to make multiple word search grid
I have an Input of lines of text (containing string of numbers and letters) like this:
2 <--- tells how many grids/boxes
3 <--- tells rows/length
4 <--- tells columns/width
catt <--\
aata <--- letters that will fill the box
tatc <--/
cat <--- the word that will be search inside the box
5 <--- and repeat but start with the rows
5
gogog
ooooo
godog
ooooo
gogog
dog
all of that comes in one list as an input
However, I need to pass variables inside. so I assume that I need to split/slice the list into another lists containing all variables that I need.
I think I need to split the variables for cat and dog like this:
#variables for cat and dog
rows, cols = [3, 5], [4, 5] #the numbers have to be integer
matrix = [['catt', 'aata', 'tatc'], ['gogog', 'ooooo', 'godog', 'ooooo', 'gogog']]
word = ['cat', 'dog']
those are the variables I need. but I don't know how to split it like that from the input above.
If there are any different ways, feel free to explain. Thank you