repr
repr is a built-in Python function that returns a string representation of an object. The string is intended to be unambiguous and, when feasible, could be used to recreate the object. This contrasts with str(), which aims for a readable, user-facing display.
The representation is produced by the object's __repr__ method. If a class does not define __repr__, the
Examples show typical behavior: repr(42) yields '42'; repr('hello') yields "'hello'"; repr([1, 2, 3]) yields '[1, 2, 3]'.
Notes and limitations: repr is not guaranteed to be a valid Python expression for all objects, especially
Relation to formatting: repr is often used for debugging and logging, while user-facing messages typically rely