Python Forum
list comprehension : print column as row
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
list comprehension : print column as row
#5
Perfect, Thank you very much, works like charm.
Lately, I have solved to not printing the original matrix, something like :


for row in range(len(matrix)):
    print(row)
for col in range(len(matrix[i])):
    print(matrix([col][row], end=" ")
print()
Reply


Messages In This Thread
RE: list comprehension : print column as row - by pyseeker - Sep-05-2019, 05:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  List Comprehension Issue johnywhy 5 553 Jan-14-2024, 07:58 AM
Last Post: Pedroski55
Question mypy unable to analyse types of tuple elements in a list comprehension tomciodev 1 503 Oct-17-2023, 09:46 AM
Last Post: tomciodev
  How do you get Python to print just one value in a list? 357mag 3 1,038 May-17-2023, 09:52 PM
Last Post: rob101
  Using list comprehension with 'yield' in function tester_V 5 1,284 Apr-02-2023, 06:31 PM
Last Post: tester_V
  list comprehension 3lnyn0 4 1,445 Jul-12-2022, 09:49 AM
Last Post: DeaD_EyE
  Print List to Terminal DaveG 2 1,451 Apr-02-2022, 11:25 AM
Last Post: perfringo
  Not able to add extra column to the list in the python shantanu97 2 1,669 Nov-17-2021, 10:14 AM
Last Post: snippsat
  List comprehension used differently coder_sw99 3 1,747 Oct-03-2021, 04:12 PM
Last Post: coder_sw99
  How to invoke a function with return statement in list comprehension? maiya 4 2,895 Jul-17-2021, 04:30 PM
Last Post: maiya
  List comprehension and Lambda cametan 2 2,264 Jun-08-2021, 08:29 AM
Last Post: cametan

Forum Jump:

User Panel Messages

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