Function Details: repr

Description


Returns a string containing a printable representation of an object.


Extended Description


The repr() function returns a string containing a printable representation of an object. For many types, this function makes an attempt to return a string that would yield an object with the same value when passed to eval(). If this is not possible, a string of the form <...some useful description...> is returned. repr() is often used for debugging as it provides more information about the object than str().


Read More about repr from Python Documentation

Function Signature


repr(object: Any) -> str

Module: builtins

Parameters



Parameter List


  • object: Any

Return


Returns a string representation of the object.


Return Type


str

Output

Explanation

These examples show how repr() works with different types of objects.