Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the difference between `__str__` and `__repr__` methods in Python?



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

Post New Answer

More Python Interview Questions

Can you name ten built-in functions in python and explain each in brief?

0 Answers  


Does every class need a constructor?

0 Answers  


Explain how can you generate random numbers in python?

0 Answers  


What is pytest in python?

0 Answers  


Finally, tell us about bitwise operators in python?

0 Answers  


What is pythonpath?

0 Answers  


How is print statement represented in python 3 (v/s python2)?

0 Answers  


How does exception handling in python differ from java?

0 Answers  


What are local variables in python?

0 Answers  


What are the packages?

0 Answers  


Explain me what are the principal differences between the lambda and def?

0 Answers  


Explain how to make Forms in python.

1 Answers  


Categories