By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,818 Members | 1,223 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,818 IT Pros & Developers. It's quick & easy.

Compare elements in a matrix

P: 3
Hi!

I'm learning python and I have a question about matix.

Expand|Select|Wrap|Line Numbers
  1. ef __init__(self,colors=[], forms=[], numbers=[], grades=[]):
  2.         self.cardList = []
  3.         self.playerCardList = []
  4.         self.lista3 = []
  5.         self.lista4 = []
  6.         for color in colors:
  7.             for form in forms:
  8.                 for number in numbers:
  9.                     for grade in grades:
  10.                         tmp= Kort(color, form, number, grade)
  11.                         self.cardList.append(tmp)
  12.  
I think that this method creates a matrix, right?

How can I, in an easy way, compare the elements in the matrix to one another?

Thanks!
Dec 5 '10 #1
Share this Question
Share on Google+
1 Reply


bvdet
Expert Mod 2.5K+
P: 2,851
Your code creates a list of Kort instances. List elements are accessed by index.
Dec 6 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.