The repr() function is used to get the printable string representation of an object.  

Syntax:
repr(object)

The single argument , object,  can be any valid value such as an integer, a string, lists, a user-defined class, a function, etc.

ExampleEdit & Run
print( repr(1) )

print( repr(list) )

print( repr("Python") )

print( repr(True) )

print( repr({1:'one'}) )
Output:
1 <class 'list'> 'Python' True {1: 'one'} [Finished in 0.015334231000004195s]

The built-in print() function actually prints the string returned by repr(object) .

User defined objects can customize their printable representation by overriding the __repr__() method.

ExampleEdit & Run
class Example1:
     def __init__(self):
        self.name = 'Instance'
e1 = Example1()
print(e1)

class Example2:
    def __init__(self):
        self.name = 'Example2 Instance'
    def __repr__(self):
        return self.name
       
e2 = Example2()
print(e2)
Output:
<__main__.Example1 object at 0x7f963bac3950> Example2 Instance [Finished in 0.014185720000000401s]