flatten a nested string array but keep the words intact?

11 Views Asked by At

Original input:

pattern = ["['AutoFocus', 'AutoCenter']", 'Images']

Desired output:

pattern = ['AutoFocus', 'AutoCenter', 'Images']

All the methods I tried from the posts I checked gave me the following:

['[', "'", 'A', 'u', 't', 'o', 'F', 'o', 'c', 'u', 's', "'", ',', ' ', "'", 'A', 'u', 't', 'o', 'C', 'e', 'n', 't', 'e', 'r', "'", ']', 'I', 'm', 'a', 'g', 'e', 's']

python3.10 environment. Any keywords I can used for the search will be much appreciated.

0

There are 0 best solutions below