-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
  • 55,782
  • 14
  • 81
  • 108
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,440
  • 1
  • 8
  • 26