predict the outcome numbers using a list
I have 3 lists with 3 sets of integers. I want to predict the outcome numbers using a list or by whatever other means is out there.
List1 = [0 0 2 0 1 2] List2 = [3 0 1 0 1 0] List3 = [0 0 2 1 1 1]
Im working in the first column, I was thinking of using a double if statement something like:
if 3 is in spot 0 of any list and 0 is in spot 0 of any list print 2
The other thing is I want to do this for all the other columns as well.
I know this is not complete but its on my mind like this and ive been
searching around and found nothing to solve this problem.
I would greatly appeciate any response to this question.
You cant define a list delimited with space; you have to use a comma',' instead.
l1=[0,0,2,0,1,2] l2=[3,0,1,0,1,0,] l3=[0,0,2,1,1,1] spot0_list = zip(l1,l2,l3) if 3 in spot0_list and 0 in spot0_list: print 2
And, if there are too many lists, you can use set:
spot0_list = set(zip(l1,l2,l3))