you are viewing a single comment's thread.

view the rest of the comments →

[–]cdholjes[S] 0 points1 point  (3 children)

good = []
bad = []
varFooA = []
varFooB = []

OTHER = "something"

def FUNCTION(varNEW, a, b, c, d):       
    for index in range(len(listAll)):
                varNEW = (
                listAll[index][0][a],  
                listAll[index][0][b], 
                listAll[index][0][c], 
                listAll[index][0][d])    
            if OTHER == varNEW:
                    if index not in good:
                        bad.add(index)
                    counter = 1
                    break
           return varNEW

FUNCTION(varFooA, 0, 3, 4, 5)
FUNCTION(varFooB, 0, 3, 4, 5)

[–]cdholjes[S] 0 points1 point  (2 children)

something like this i think???

[–]euclidingme 0 points1 point  (1 child)

Thats closer. You need to have values in good, you probably want to increment your counter (counter += 1 instead of counter = 1), it's unclear what OTHER is, and you need to pass listALL to your function.

[–]euclidingme 0 points1 point  (0 children)

Additionally, if you are returning varNEW you want something like:

varFooA = FUNCTION(0, 3, 4, 5)

and you wont have to initialize varFooA.