class Foo:

    def __str__(self):
        return '__str__'

def __repr__(self):
    return '__repr__'
bar = Foo()
bar
print(bar)
repr(bar)
How to print a list, dict or collection of objects, in Python