I have a function within which I have a for loop that is looking for a certain string, which if true executes a different function. What I can't work out is how to create a variable within which to store the outcome of the for loop. I want to take the outcome (i.e. this function was executed or this string was present) and pass that into another function but I cannot get the variable to remember the outcome. Any help would be greatly greatly appreciated. Thank you
for something in something:
def a_func():
if this == 'A':
func_1()
if this == 'B':
func_2()
if this == 'C':
func_3()
if this == 'D':
func_4()
return this
this = a_func()