Python repr() Function
Description
The repr() function converts an object into a form that can be read by the interpreter.
Syntax
The following is the syntax of the repr() method:
repr(object)
Parameters
- object -- the object.
Return Value
Returns the string representation of an object.
Example
The following examples demonstrate the use of the repr() method:
s
=
'RUNOOB'
repr
(
s
)
"'RUNOOB'"
dict
=
{
'runoob'
:
'runoob.com'
,
'google'
:
'google.com'
}
;
repr
(
dict
)
"{'google': 'google.com', 'runoob': 'runoob.com'}"
Python built-in function