473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Compare elements in a matrix

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
1 2307
bvdet
2,851 Expert Mod 2GB
Your code creates a list of Kort instances. List elements are accessed by index.
Dec 6 '10 #2

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

Similar topics

24
by: superprad | last post by:
Is there an easy way to grab the Unique elements from a list? For Example: data = what I am looking for is the unique elements 0.4 and 0.9 with their index from the list. Probably something...
0
by: damiaotomas | last post by:
Hi I'm trying to write a c++ code in which I create a matrix (no randomly), and compare every row of this matrix with a vector x in order to find the distance of every row related to the vector....
3
by: robix | last post by:
Hi again. I'm now asking your help because of a smal problem i'm getting with my multiplication matrix code. I'll try to give you as many details as possible. My matrix structure: typedef...
122
by: Einar | last post by:
Hi, I wonder if there is a nice bit twiddling hack to compare a large number of variables? If you first store them in an array, you can do: for (i = 0; i < n; i++) { if (array != value) {...
4
by: L. | last post by:
Hello, I need to generate random Matrices (say of size 5*5), each with an average of X (say X=0.5), but with different values’ range. One matrix should have values in the range of 0-1, while...
1
by: blazted | last post by:
I am trying to find our how I would compare two matrix's. I have two matrix and I want to find out if they are equal, less or greater than. I created a double loop to loop through and compare...
8
by: Matt | last post by:
Hello. I'm struggling to work out what bit of matrix manipulation the following piece of code is doing to the 3x3 matrix given: #include <stdio.h> int main() { int check_mat = { { 1 , 2...
11
by: subodheee | last post by:
i have a problem in implementing script,i have to extract from below data op,offset,and i need to compare the if same offset,same op repeats in other process i need to make it as same,else no .please...
4
by: kayjay66 | last post by:
hello! MY CODE IS RUNNING AND IT'S ALL FINE, I ONLY NEED TO KNOW HOW TO MODIFY IT AND MAKE IT RUN ON A CORE 2 DUO INTEL CENTRINO. i have written 2 programs, the first one is only for creating...
6
Avatar19
by: Avatar19 | last post by:
Hi, I would like to compare elements in two seperate Lists for example: List1=, , ] List2=, ] What I understand is that the syntax should look like this: List3 for i in List2: for j in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.