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.

Answers


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)[0]
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)[0])

Need Your Help

Make animation with several div's in a loop

javascript jquery animation sequence

I have a working animation jquery script here: jsfiddle

Populate a drop down box with values from database using php and sql

php sql drop-down-menu

I want to have a drop down box that has a list of different sizes of item. I have a table called items in my database with an attribute inside it called sizes. This maps to a table called sizes which

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.