Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flipping matrices problem
#2
Are the input matrices guaranteed to be square? The problem doesn't say they are. In the d == 'h' section you are using len(m) for both the iteration over rows and the iteration over columns.

You should generally iterate over the list, not the indexes of the list, as shown here. Is there some reason you are not using list.reverse() or list[::-1] to reverse the list or sub-lists?
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Flipping matrices problem - by Qmohankumar0017 - Feb-20-2019, 03:52 PM
RE: Flipping matrices problem - by ichabod801 - Feb-20-2019, 04:03 PM
RE: Flipping matrices problem - by Qmohankumar0017 - Feb-20-2019, 04:04 PM
RE: Flipping matrices problem - by ichabod801 - Feb-20-2019, 04:26 PM
RE: Flipping matrices problem - by Qmohankumar0017 - Feb-20-2019, 04:44 PM
RE: Flipping matrices problem - by ichabod801 - Feb-20-2019, 05:19 PM
RE: Flipping matrices problem - by Qmohankumar0017 - Feb-20-2019, 05:30 PM
RE: Flipping matrices problem - by ichabod801 - Feb-20-2019, 05:37 PM
RE: Flipping matrices problem - by Qmohankumar0017 - Feb-20-2019, 06:00 PM
RE: Flipping matrices problem - by ichabod801 - Feb-20-2019, 06:44 PM
RE: Flipping matrices problem - by buran - Feb-20-2019, 06:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Numpy, array(2d,bool), flipping regions. MvGulik 2 1,152 Oct-27-2024, 11:06 AM
Last Post: MvGulik
  4D matrices ali1almakhmari 0 1,292 Jun-13-2022, 09:21 AM
Last Post: ali1almakhmari
  Unable to use Pauli Matrices in QNET Package Rupayan 2 2,706 Sep-25-2021, 06:02 AM
Last Post: Rupayan
  Python: Automated Script to Read Multiple Files in Respective Matrices Robotguy 7 6,396 Jul-03-2020, 01:34 AM
Last Post: bowlofred
  Application of dilute matrices chris_drak 0 1,877 Mar-29-2020, 03:04 PM
Last Post: chris_drak
  Partial "visual" Matching of matrices masteripper 15 7,947 Nov-03-2019, 05:41 PM
Last Post: masteripper
  flipping the for loop in file juniorcoder 2 3,058 Oct-21-2018, 01:47 PM
Last Post: wavic
  matrices math problem lokoprof 1 2,934 Aug-27-2018, 07:48 PM
Last Post: perfringo

Forum Jump:

User Panel Messages

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