Skip to content
Built-in Functions

repr()

Get a detailed string representation of a value.

repr(object)

repr() returns text that is useful for seeing a value clearly.

For strings, it includes quotes and shows special characters with escape notation.

Parameters

NameDescription
objectThe value to represent as text.

Returns

A string representation.

Try it

Run it and change it
message = "hi\nthere"
print(repr(message))

Related entries