Python lists are very flexible and can hold completely heterogeneous, arbitrary data, and they can be appended to very efficiently, in amortized constant time. If you need to shrink and grow your list time-efficiently and without hassle, they are the way to go.
You can store them into a list.
words = []
for a in names:
words.append(a['id']['name'])
Or
You can use list comprehensions. This will replace your for loop entirely:
words = [a['id']['name'] for a in names]
I want to put all of these names into an array, and keep it inside the variable 'words'.
I am assuming you are flexible to use any data structure in Python and by array, you just mean a sequence data type. However, I am adding some information on array for the sake of completeness.
An array is a data structure that stores values of same data type. In Python, this is the main difference between arrays and lists. While python lists can contain values corresponding to different data types, arrays in python can only contain values corresponding to same data type.
listand appenda['id']['name']in each iteration.