The repr()
function is used to get the printable string representation of an object.
repr(object)
copy
The single argument , object
, can be any valid value such as an integer, a string, lists, a user-defined class, a function, etc.
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.