Compare elements in a matrix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Johan Novak
    New Member
    • Dec 2010
    • 3

    Compare elements in a matrix

    Hi!

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

    Code:
    ef __init__(self,colors=[], forms=[], numbers=[], grades=[]):
            self.cardList = []
            self.playerCardList = []
            self.lista3 = []
            self.lista4 = []
            for color in colors:
                for form in forms:
                    for number in numbers:
                        for grade in grades:
                            tmp= Kort(color, form, number, grade)
                            self.cardList.append(tmp)
    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!
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    Your code creates a list of Kort instances. List elements are accessed by index.

    Comment

    Working...