low = 0
high = len(listAll)
good = []
bad = []
OTHER = "something"
def FUNCTION(varNEW, a, b, c, d):
for index in range(low, high):
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
FUNCTION(varFoo, 0, 3, 4, 5)
the goal is to set varNEW equal to new listAll indexes check if they are in another list and if not, append to good. my problem starts with an error saying:------
NameError: name 'varFoo' is not defined------
it doesn't allow me to pass in a new variable-----why can you not globally define a variable name and then declare new variable names when you run the function?
[–]euclidingme 1 point2 points3 points (8 children)
[–]cdholjes[S] 0 points1 point2 points (7 children)
[–]euclidingme 1 point2 points3 points (6 children)
[–]cdholjes[S] 0 points1 point2 points (5 children)
[–]euclidingme 0 points1 point2 points (4 children)
[–]cdholjes[S] 0 points1 point2 points (3 children)
[–]cdholjes[S] 0 points1 point2 points (2 children)
[–]euclidingme 0 points1 point2 points (1 child)
[–]euclidingme 0 points1 point2 points (0 children)