0

I keep getting this, [<main.state object at 0x00D571C0>]

I want to print q

[Here I want to make a queue object. when I want to print q and the error comes. how to solve it?][1]
import numpy as np
start=np.array([[9,8,7],[6,5,4],[3,2,1]])

class state:
    def __init__(self,matno,parentno,mat):
        self.matno=matno
        self.parentno=parentno
        self.mat=mat
    def display(self):
        return f"matno:{self.matno},parentno:{self.parentno},mat:{self.mat}"

obj=state(1,0,start)
q=[]
q.append(obj)
print(q)
  • That's not an error, that's how a list with a single Python object is represented. What output do you expect? – Jan Wilamowski Jul 07 '21 at 03:17
  • Does this answer your question? [How to print instances of a class using print()?](https://stackoverflow.com/questions/1535327/how-to-print-instances-of-a-class-using-print) – Jan Wilamowski Jul 07 '21 at 03:21

0 Answers0