Andrew Breza

35%
Flag icon
Every object-oriented language has at least one standard way of getting a string representation from any object. Python has two: repr() Return a string representing the object as the developer wants to see it. It’s what you get when the Python console or a debugger shows an object. str() Return a string representing the object as the user wants to see it. It’s what you get when you print() an object.
Fluent Python: Clear, Concise, and Effective Programming
Rate this book
Clear rating
Open Preview