-3
( with the given inputs L = [1,2,3,4,5,6,7,8,9] )

how to display 3 * 3 matrix in python without Numpy function

khelwood
  • 52,115
  • 13
  • 74
  • 94
dcod3__
  • 1
  • 5

1 Answers1

0

The answer to your question is the same as this answer:

L = [1,2,3,4,5,6,7,8,9]
L = [L[i:i+3] for i in range(0, len(L), 3)]
print(L)

Output:

[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
Sushil
  • 5,231
  • 1
  • 7
  • 23