I start out with an empty list and prompt the user for a phrase. I want to add each character as a single element of the array, but the way I'm doing this creates a list of lists.
myList = []
for i in range(3):
myPhrase = input("Enter some words: ")
myList.append(list(myPhrase))
print(myList)
I get:
Enter some words: hi bob
[['h', 'i', ' ', 'b', 'o', 'b']]
Enter some words: ok
[['h', 'i', ' ', 'b', 'o', 'b'], ['o', 'k']]
Enter some words: bye
[['h', 'i', ' ', 'b', 'o', 'b'], ['o', 'k'], ['b', 'y', 'e']]
but the result I want is:
['h', 'i', ' ', 'b' ... 'o', 'k', 'b', 'y', 'e']