I'm new to Python and I'm attempting to place each individual character of a string into an individual element of an array.
string= 'Hello'
array= []
length_of_string= len(string)-1
for i in range (length_of_string):
array.append(string(i))
print(array)
However when I run this code an error occurs as shown below.
array.append(string(i))
TypeError: 'str' object is not callable
The append
function works fine when I append to an array using strings or numbers normally but in this instance it does not work.
What do I have to do to get
['H','e','l','l','o']