Python Forum

Full Version: hide object type in printing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi
I have an 2d array A.which each elements of it is a list . when I print A, It gives me sth like this:

[list([]) list([]) list([])]
[list([]) list([]) list([])]
[list([]) list([]) list([])]]

but i dont like to show 'list' word in the print result! Sad
thanks for ur help in advance.
+i use python 3
Please, post whatever code you have - in python tags
this is what I wrote:

import numpy as np
A=np.zeros((3,3),dtype=object) #or object

for i in range(3):
    for j in range(3):
        A[i,j]=[] #wanna be empty list to be filled later 

print(A)
output:
Output:
[list([]) list([]) list([])] [list([]) list([]) list([])] [list([]) list([]) list([])]]