I have a variable called result
which is equal to this list [[0, ''], [1, ''], [2, ''], [3, 'x'], [4, 'x']]
. I want to change that list into 'xx'
, so I can print that data to the screen of the player. Anyway I could do this?
My attempt so far:
res = [''.join(ele) for ele in str(result)]
Output:
['[', '[', '0', ',', ' ', "'", '', "'", ']', ',', ' ', '[', '1', ',', ' ', "'", '', "'", ']', ',', ' ', '[', '2', ',', ' ', "'", '', "'", ']', ',', ' ', '[', '3', ',', ' ', "'", 'x', "'", ']', ',', ' ', '[', '4', ',', ' ', "'", 'x', "'", ']', ']']