What is the difference between `__str__` and `__repr__` methods in Python?
Answer / nashiinformaticssolutions
`__str__` is used for creating a user-friendly string representation of an object. `__repr__` is used for creating a detailed string representation of an object, intended for debugging.
| Is This Answer Correct ? | 0 Yes | 0 No |
Can you name ten built-in functions in python and explain each in brief?
Does every class need a constructor?
Explain how can you generate random numbers in python?
What is pytest in python?
Finally, tell us about bitwise operators in python?
What is pythonpath?
How is print statement represented in python 3 (v/s python2)?
How does exception handling in python differ from java?
What are local variables in python?
What are the packages?
Explain me what are the principal differences between the lambda and def?
Explain how to make Forms in python.