Apr-16-2023, 04:53 PM
(This post was last modified: Apr-16-2023, 04:53 PM by deanhystad.)
You don't have a variable named input_str assigned outside my_function().
def my_function(): input_str = Element('input.str').value # Assigned inside function n = int(Element('n').value) input_list = input_str.split(",") # Never assigned out hereIs this an indentation error?
for i in range(len(w)): if (w[i] % n == 0): A[w[i]//n - 1, n-1] = int(i+1) else: A[w[i]//n, w[i]%n-1] = int(i+1) result_place = Element('output') # Should these lines be same depth as else? result_place.write(str(A))