Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Flipping matrices problem
#3
Thank you!
Sorry didn't know that.
I'll make sure to add python tag in the future

(Feb-20-2019, 04:03 PM)ichabod801 Wrote: 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?
I got the matrix they are using for tests.
[[1,2], [3,4]] this when flipped vertically works without any problem
But when flipped horizontally it shows side effect.(These are in the website in which I have to submit my assignment. The website provides a python 3 terminal to paste the codes and run the script)
So I tried running the same script in my laptop. Both the cases worked without any errors and I get the correct output too!
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
  4D matrices ali1almakhmari 0 805 Jun-13-2022, 09:21 AM
Last Post: ali1almakhmari
  Unable to use Pauli Matrices in QNET Package Rupayan 2 1,987 Sep-25-2021, 06:02 AM
Last Post: Rupayan
  Python: Automated Script to Read Multiple Files in Respective Matrices Robotguy 7 4,419 Jul-03-2020, 01:34 AM
Last Post: bowlofred
  Application of dilute matrices chris_drak 0 1,405 Mar-29-2020, 03:04 PM
Last Post: chris_drak
  Partial "visual" Matching of matrices masteripper 15 5,636 Nov-03-2019, 05:41 PM
Last Post: masteripper
  flipping the for loop in file juniorcoder 2 2,318 Oct-21-2018, 01:47 PM
Last Post: wavic
  matrices math problem lokoprof 1 2,278 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