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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the __ init __ method used for?

844


What does len () mean in python?

825


How do you execute a python script?

950


What is a means by “tuple in python”?

881


What is tuple when we have to use ?

795


How can you sort a list in reverse order in python?

898


What is a variable in python?

819


What is multithreading? Give an example?

796


What is split used for?

787


In python, how can you generate random numbers?

859


Explain other string literals?

859


What is meta class in python?

893


What is python keyword?

810


Can python be used for web client and web server side programming? And which one is best suited to python?

780


Why is using ‘eval’ a bad practice?

884