How to apply __str__ function when printing a list of objects in Python [duplicate]

Try:

class Test:
   def __repr__(self):
       return 'asd'

And read this documentation link:

Leave a Comment