i wrote the following function:
def get_running_time(test):
for line in PERFORMANCE_FILE:
print(test_time)
line_rr = line.split()
test_time = int(line_rr[-2])
print(test_time)
return test_time
and i get the error:
"local variable 'test_time' referenced before assignment"
i saw all of the solutions relay on globals but i dont want to use that. i tried using globals but it makes things more complicated for me because when i call the function "get running time" it does not consider the initialization of "test_time" in the beginning and the global remains the same number through out the entire running of the program. is there another way to solve this? thanks.
IndentationErroralready at thefor. ;)