>>> import ast
>>> x = '[ "A","B","C" , " D"]'
>>> x = ast.literal_eval(x)
>>> x
['A', 'B', 'C', ' D']
>>> x = [n.strip() for n in x]
>>> x
['A', 'B', 'C', 'D']

ast.literal_eval:

Evaluate an expression node or a string containing only a Python literal or container display. The string or node provided may only consist of the following Python literal structures: strings, bytes, numbers, tuples, lists, dicts, sets, booleans, None and Ellipsis.

This can be used for evaluating strings containing Python values without the need to parse the values oneself. It is not capable of evaluating arbitrarily complex expressions, for example involving operators or indexing.

Answer from Roger Pate on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-convert-array-ordinary-list-items
Python - Convert an array to an ordinary list with the same items - GeeksforGeeks
December 17, 2024 - Sometimes, we need to convert these arrays to a simple Python list for easier manipulation or compatibility with other functions. list() function is the most straightforward way to convert different types of array-like objects into a Python list.
🌐
Reddit
reddit.com › r/learnpython › converting a lists of characters into a list of strings
r/learnpython on Reddit: Converting a lists of characters into a list of strings
December 19, 2022 - so, if you want, lets say, to turn ['a', 'b', 'c'] into 'abc', you can use, as a separator, an emptry string, like "", and pass the list to the join method, like this: ... now you know what the .join() method does, let's break down the line ...
🌐
Python Guides
pythonguides.com › convert-numpy-array-to-list-in-python
Convert NumPy Array to List in Python: 5 Simple Methods
September 22, 2026 - Using tolist() in NumPy provides a clean and reliable way to convert arrays, regardless of their data type, into native Python lists. It works seamlessly for strings, booleans, and even mixed-type object arrays.
🌐
freeCodeCamp
freecodecamp.org › news › python-string-to-array-how-to-convert-text-to-a-list
Python String to Array – How to Convert Text to a List
February 21, 2022 - However, you can reassign a different string by updating the variable, like so: fave_language = "python" fave_language = "Python" print(fave_language) #output #Python · A list is an ordered collection of data.
🌐
PyTutorial
pytutorial.com › python-array-to-string-3-easy-methods
PyTutorial | Python Array to String: 3 Easy Methods
August 15, 2026 - We will focus on three main approaches. First, we'll use the join() method, which is the most straightforward. Second, we'll explore using map() for arrays with non-string elements.
Find elsewhere
🌐
CodeRivers
coderivers.org › blog › python-string-array
Python String Arrays: A Comprehensive Guide — CodeRivers
In Python, there is no dedicated "string array" data type. Instead, you use **lists** to store sequences of strings. A list of strings—often called a "string array"—is one of the most common data structures in Python, used in everything from text processing and data analysis to web scraping ...
🌐
CodeRivers
coderivers.org › blog › python-array-of-strings
Python Array of Strings: A Comprehensive Guide — CodeRivers
In Python, while there is no built-in array type specifically for strings like some other programming languages, we can use lists to achieve similar functionality. Lists in Python are versatile data structures that can hold elements of different types, including strings.
🌐
Python Guides
pythonguides.com › convert-numpy-array-to-list-of-strings-in-python
Convert NumPy Array to String in Python (6 Easy Methods)
May 15, 2025 - import numpy as np # Create a NumPy array arr = np.array([3.14159, 2.71828, 1.41421]) # Convert to string using array_str() string_arr = np.array_str(arr, precision=3) print(string_arr) ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › create-a-list-of-strings-in-python
Create a List of Strings in Python - GeeksforGeeks
July 23, 2025 - For example, if we have names of people in a group, we can store them in a list. We can create a list of strings by using Square Brackets [] . We just need to type the strings inside the brackets and separate them with commas.
🌐
PyTutorial
pytutorial.com › python-array-of-strings-easy-guide
PyTutorial | Python Array of Strings: Easy Guide
August 17, 2026 - Check out this guide on Python Array Iteration: For vs While Loop for a deep dive. Python lists come with many built-in methods. These help you perform common tasks easily. Let's look at a few essential ones. The join() method is used to concatenate all strings into one.
🌐
Python Pool
pythonpool.com › home › tutorials › array of strings in python: lists, array, and numpy
Array of Strings in Python: Lists, array, and NumPy - Python Pool
July 13, 2026 - If the list contains numbers or other objects, convert them to strings first. A compact option is map(str, items), but a loop can be clearer when formatting rules differ by item. For output that will be parsed later, prefer a real format such as CSV or JSON instead of building a custom string by hand. join() is best for simple display text or controlled separators. The practical rule is simple: use a Python list for an array of strings, keep the text rules explicit, and choose the operation that matches the next step.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-program-to-convert-list-of-integer-to-list-of-string
Python - Convert List of Integers to a List of Strings - GeeksforGeeks
July 12, 2025 - We then loop through each element x in list a, convert it to a string using str(), and append it to the list b.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-program-convert-string-list
Convert String to a List in Python - GeeksforGeeks
Explanation: expression iterates through every character in the string and stores each one as a separate element in the resulting list. split() method also allows splitting a string using a custom separator instead of spaces.
Published: July 16, 2026
🌐
DigitalOcean
digitalocean.com › community › tutorials › python-convert-numpy-array-to-list
Convert NumPy Array to List in Python Easily | DigitalOcean
April 19, 2025 - Learn how to convert a NumPy array to a Python list using simple methods with code examples. Ideal for beginners and data scientists working with NumPy.
🌐
Great Learning
mygreatlearning.com › blog › it/software development › how to convert list to string in python
How to convert List to String in Python
November 7, 2024 - A list is a collection of objects that are ordered. Also, each element in the list is indexed according to a definite sequence, and a list's indexing is done with 0 being the first index. The list is a ‘Collection Datatype’ that can contain integers, strings, or other lists too. Lists are mutable, hence, they can be changed even after their creation. Also, note that lists can contain duplicate entries, unlike sets. Python lists can be created in the following way:
🌐
Stack Overflow
stackoverflow.com › questions › 47188054 › converting-a-list-of-strings-to-an-array-in-python
Converting a list of strings to an array in Python - Stack Overflow
I have some code that loops through files and grabs a datetime string and appends the string in each file to an empty list. I am trying to convert this list of strings into an array of strings: