
The reprt function is used to obtain a canonical string representation of the object. Backticks (also called conversion or reverse quotes) do the same thing. Note that you will have eval(repr(object)) == object most of the time.
>>> i = []
>>> i.append('item') >>> `i`
"['item']"
>>> repr(i)
"['item']"
Basically, the repr function or the backticks are used to obtain a printable representation of the object. you can control what your objects return for therepr function by defining the__repr__ method in your class.
Describe what you're looking for in as much detail as you'd like.
Our AI reads your request and finds the best matching books for you.
Popular searches:
Join 2 million readers and get unlimited free ebooks