Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Matrix
#5
(Feb-02-2019, 04:30 AM)ichabod801 Wrote: Note that your code checks that all the items are 'X'. To check that they are all equal (no matter what they are), check against matrix[0][0] instead (that's the first item in the first row).

I don't know is it important or not but just observing that in case of empty matrix (list of empty lists) checking against matrix[0][0] will give IndexError.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
Matrix - by Helmi - Feb-02-2019, 03:02 AM
RE: Matrix - by ichabod801 - Feb-02-2019, 03:06 AM
RE: Matrix - by Helmi - Feb-02-2019, 03:34 AM
RE: Matrix - by ichabod801 - Feb-02-2019, 04:30 AM
RE: Matrix - by perfringo - Feb-02-2019, 04:58 AM
RE: Matrix - by perfringo - Feb-02-2019, 08:37 AM
RE: Matrix - by Helmi - Feb-02-2019, 01:02 PM
RE: Matrix - by ichabod801 - Feb-02-2019, 04:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Check if two matrix are equal and of not add the matrix to the list quest 3 971 Jul-10-2023, 02:41 AM
Last Post: deanhystad
  How to multiply a matrix with herself, until the zero matrix results peanutbutterandjelly 3 3,498 May-03-2021, 06:30 AM
Last Post: Gribouillis
  matrix from matrix python numpy array shei7141 1 3,807 Jan-16-2017, 06:10 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020