repr()Easy Examples

Returns a developer-friendly string representation of an object

Basic repr() usage

Simple demonstration of the repr() built-in function.

python
print(repr("hello"))
print(repr(42))
print(repr([1, 2, 3]))

repr() is a built-in function that returns a developer-friendly string representation of an object.

repr() with different inputs

Calling repr() with various argument types.

python
# More repr() examples
print("repr() is a Python built-in function")
print(f"Type: {type(repr)}")

repr() accepts different types of arguments and produces corresponding results.

Want to try these examples interactively?

Open Easy Playground