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

Why is self used in python?

791


What does __ name __ mean in python?

771


Does python interact with database?

885


What are attributes in python?

771


Do you need python to run a python program?

794


What is the __ init __ method used for?

835


What are the two main data types in python?

827


What is anaconda program?

875


What is defined isalpha() in python?

877


How do you comment in python?

753


find max length of any given sublist?

837


What kinds of patterns could I enforce on the code to make it easier to translate to another programming language?

796


I am from non technical Background. In how many days I can learn the python? and What I need to do for that?

2330


What is python written in?

847


Tell me what is pep 8?

793