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 |
Explain polymorphism in Python.
What does [::-1} do?
Is set iterable python?
How do you sort in descending order in python?
Why do we want to use break statement in while-loop?
Why python has no private?
How will you convert an integer to a hexadecimal string in python?
Explain how to create a multidimensional list.
How do you split a list into evenly sized chunks?
What is for-else and while-else in python?
What is a sequence in python?
How will you differentiate between deep copy and shallow copy?