Jan-18-2019, 07:04 PM
Basicly I have a certain amount of positions (1-3) which can be either True or False.
I want the function I use to get the decent index value.
So
pos1 T
pos2 F
pos3 T
gives indexes 0 and 1
while example below gives 0, 1, 2
and
pos1 T
pos2 F
pos3 F
gives index 0
To me my code feels a bit strange. Lack of knowledge for sure, so what would you suggest?
I want the function I use to get the decent index value.
So
pos1 T
pos2 F
pos3 T
gives indexes 0 and 1
while example below gives 0, 1, 2
and
pos1 T
pos2 F
pos3 F
gives index 0
To me my code feels a bit strange. Lack of knowledge for sure, so what would you suggest?
triggers = [100,200,300]
pos1 = True #never changes
pos2 = True
pos3 = True
Somevalue = 3
pos1 = triggers[0]
if pos2:
customfunction(a, b, triggers[1])
if pos3:
customfunction(a, c,triggers[2])
elif pos3:
customfunction(a, c, triggers[1])