I have a list as below:
a_list=['i']
I also have this string:
a_string='i dont know where i belong but i know i am okay here'
How would I iterate over the string to find each index where the list term occurs? I was thinking of doing linear search but I am already within a function and can't figure out how to import the list from the outer function to the nested function where I would define the linear search.
Edit: I found the answer to this after some time. I was simply unsure of how functions could work in other functions. I was worried that nesting functions within each other could lead to errors.