Sorry if this is a noob question. But I am new to programming so I am still learning.
I have a string
string = "Hello Bye Hi" I split it up:
new_list_string = string.split output:
["Hello", "Bye", "Hi"] My question is how can I use this newly generated list, for example.
if I do this:
new_list_string[1] I don't get "Bye", instead I get an error:
builtins.TypeError: 'builtin_function_or_method' object is not iterable
string.split()you need to add parens to call the method, also try to avoid usingstringas a variable name.