Feb-13-2021, 04:45 AM
print() should only print things like this "<__main__.e object at 0x0000016BF4C0F880>" if the thing being printed does not have a more natural string representation. In Python everything is an object, even numbers. You would be very disappointed if this happened.
x = 3+5 print(x)
Output:<int object at x0000016BF4C0F880>
If you write classes that have a reasonable string representation you should write dunder methods __str__ and/or __repr__ so you can get better information displayed from a print.